Fix bug with redundadnt unbans.

This commit is contained in:
Jeremy Fincher 2004-10-19 01:48:58 +00:00
parent 6d62500a07
commit 80260623ec

View File

@ -338,7 +338,9 @@ class Channel(callbacks.Privmsg):
irc.queueMsg(ircmsgs.kick(channel, bannedNick, reason)) irc.queueMsg(ircmsgs.kick(channel, bannedNick, reason))
if length > 0: if length > 0:
def f(): def f():
irc.queueMsg(ircmsgs.unban(channel, banmask)) if channel in irc.state.channels and \
banmask in irc.state.channels[channel].bans:
irc.queueMsg(ircmsgs.unban(channel, banmask))
schedule.addEvent(f, time.time() + length) schedule.addEvent(f, time.time() + length)
if bannedNick == msg.nick: if bannedNick == msg.nick:
doBan() doBan()