reset the op status if the bot cycles the channel

This commit is contained in:
Elián Hanisch 2012-09-07 23:08:11 -03:00
parent b69bbb439f
commit fff68ca742
2 changed files with 8 additions and 0 deletions

View File

@ -1077,6 +1077,8 @@ class Bantracker(callbacks.Plugin):
self.doLog(irc, channel,
'*** %s has joined %s\n' % (msg.prefix, channel))
if msg.nick == irc.nick:
if channel in self.opped:
del self.opped[channel]
if channel in self.bans:
del self.bans[channel]
queue.queue(ircmsgs.mode(channel, 'b'))

View File

@ -576,6 +576,12 @@ class BantrackerTestCase(ChannelPluginTestCase):
self.assertEqual(cb.opped['#test'], True)
self.deop()
self.assertEqual(cb.opped['#test'], False)
self.op()
self.irc.feedMsg(ircmsgs.part('#test', prefix=self.prefix))
self.irc.feedMsg(ircmsgs.join('#test', prefix=self.prefix))
self.irc.takeMsg() # MODE msg
self.irc.takeMsg() # WHO msg
self.assertEqual(cb.opped['#test'], False)
def testOpDuration(self):
cb = self.getCallback()