diff --git a/pydle/features/rfc1459/client.py b/pydle/features/rfc1459/client.py index e689136..a7dbd27 100644 --- a/pydle/features/rfc1459/client.py +++ b/pydle/features/rfc1459/client.py @@ -389,16 +389,16 @@ class RFC1459Support(BasicClient): target, targetmeta = self._parse_user(message.params[0]) reason = message.params[1] + self._sync_user(target, targetmeta) if by in self.users: self._sync_user(by, bymeta) + self.on_kill(target, by, reason) if self.is_same_nick(self.nickname, target): self.disconnect() else: self._destroy_user(target) - self.on_kill(target, by, reason) - def on_raw_mode(self, message): """ MODE command. """ nick, metadata = self._parse_user(message.source) @@ -466,13 +466,12 @@ class RFC1459Support(BasicClient): for channel in channels: if self.in_channel(channel): self._destroy_channel(channel) + self.on_part(channel, nick, reason) else: # Someone else left. Remove them. - for ch in channels: - self._destroy_user(nick, ch) - - for channel in channels: - self.on_part(channel, nick, reason) + for channel in channels: + self._destroy_user(nick, channel) + self.on_part(channel, nick, reason) def on_raw_ping(self, message): """ PING command. """ @@ -494,8 +493,9 @@ class RFC1459Support(BasicClient): def on_raw_quit(self, message): """ QUIT command. """ - # No need to sync if the user is quitting anyway. - nick = self._parse_user(message.source)[0] + nick, metadata = self._parse_user(message.source) + + self._sync_user(nick, metadata) if message.params: reason = message.params[0] else: