From 3e64e12ded517859ffcb8b66481fef023b29ecef Mon Sep 17 00:00:00 2001 From: Nicolas Coevoet Date: Tue, 28 Jan 2014 23:27:50 +0100 Subject: [PATCH] modified a bit bot's deop, to prevent useless wait on unban/quiets/etc --- plugin.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin.py b/plugin.py index 49c8bfe..2c42af7 100644 --- a/plugin.py +++ b/plugin.py @@ -1705,13 +1705,24 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler): if not chan.deopAsked: if len(chan.queue): L = [] + index = 0 + adding = False while len(chan.queue): L.append(chan.queue.pop()) + if L[index][0].find ('+') != -1: + adding = True + index = index + 1 # remove duplicates ( should not happens but .. ) S = set(L) r = [] for item in L: r.append(item) + # if glich, just comment this if... + if not len(chan.action) and not adding: + if not self.registryValue('keepOp',channel=channel) and not self.registryValue('doNothingAboutOwnOpStatus',channel=channel): + chan.deopPending = True + chan.deopAsked = True + r.append(('-o',irc.nick)) if len(r): # create IrcMsg self._sendModes(irc,r,f)