]> jfr.im git - erebus.git/blobdiff - bot.py
add admin_channel
[erebus.git] / bot.py
diff --git a/bot.py b/bot.py
index 51b7a0a33414decb30f7dcf8ceb9a23da4ee42d8..813151b68650a837cb63c14ecd606273ac59d821 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -239,15 +239,20 @@ class Bot(object):
                if nick == self.nick:
                        self.conn.send("WHO %s c%%cant,3" % (chan))
                else:
-                       user = self.parent.user(nick, justjoined=True)
+                       user = self.parent.user(nick, send_who=True)
                        chan.userjoin(user)
                        user.join(chan)
        def _clientLeft(self, nick, chan):
-               if nick != self.nick:
-                       gone = self.parent.user(nick).part(chan)
-                       chan.userpart(self.parent.user(nick))
+               if nick == self.nick:
+                       for u in chan.users:
+                               if u.nick != self.nick:
+                                       self._clientLeft(u.nick, chan)
+               else:
+                       user = self.parent.user(nick)
+                       gone = user.part(chan)
+                       chan.userpart(user)
                        if gone:
-                               self.parent.user(nick).quit()
+                               user.quit()
                                del self.parent.users[nick.lower()]
        def _gotpart(self, pieces):
                nick = pieces[0].split('!')[0][1:]