for u in chan.users:
if u.nick != self.nick:
self._clientLeft(u.nick, chan)
+ if chan.deleting:
+ chan.bot.chans.remove(chan)
+ del self.parent.chans[chan.name.lower()]
+ del chan
else:
user = self.parent.user(nick)
gone = user.part(chan)
self.voices = []
self.ops = []
+ self.deleting = False # if true, the bot will remove cached records of this channel when the bot sees that it has left the channel
+
c = main.query("SELECT user, level FROM chusers WHERE chan = %s", (self.name,))
if c:
row = c.fetchone()
def _part(user, chan):
- chan.bot.chans.remove(chan)
- del lib.parent.chans[chan.name.lower()]
+ chan.deleting = True
lib.parent.query("DELETE FROM chusers WHERE chan = %s", (chan,))
lib.parent.query("DELETE FROM chans WHERE chname = %s", (chan,))
chan.bot.part(chan)