From 48f382917b7eeed2db18b5726cb21aca86d6c698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eli=C3=A1n=20Hanisch?= Date: Mon, 27 Aug 2012 13:59:30 -0300 Subject: [PATCH] don't request op twice --- Bantracker/plugin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Bantracker/plugin.py b/Bantracker/plugin.py index 9945094..d09b220 100644 --- a/Bantracker/plugin.py +++ b/Bantracker/plugin.py @@ -906,10 +906,12 @@ class Bantracker(callbacks.Plugin): del self.pendingReviews[None] def getOp(self, irc, channel): - msg = ircmsgs.privmsg('Chanserv', "op %s %s" % (channel, irc.nick)) - irc.queueMsg(msg) - schedule.addEvent(lambda: self._getOpFail(irc, channel), 60, - 'Bantracker_getop_%s' % channel) + name = 'Bantracker_getop_%s' % channel + # check if we aren't already waiting for op + if name not in schedule.schedule.events: + msg = ircmsgs.privmsg('Chanserv', "op %s %s" % (channel, irc.nick)) + irc.queueMsg(msg) + schedule.addEvent(lambda: self._getOpFail(irc, channel), 60, name) def _getOpFail(self, irc, channel): for c in self.registryValue('autoremove.notify.channels', channel):