modified a bit bot's deop, to prevent useless wait on unban/quiets/etc

This commit is contained in:
Nicolas Coevoet 2014-01-28 23:27:50 +01:00
parent 897746487d
commit 3e64e12ded

View File

@ -1705,13 +1705,24 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
if not chan.deopAsked: if not chan.deopAsked:
if len(chan.queue): if len(chan.queue):
L = [] L = []
index = 0
adding = False
while len(chan.queue): while len(chan.queue):
L.append(chan.queue.pop()) L.append(chan.queue.pop())
if L[index][0].find ('+') != -1:
adding = True
index = index + 1
# remove duplicates ( should not happens but .. ) # remove duplicates ( should not happens but .. )
S = set(L) S = set(L)
r = [] r = []
for item in L: for item in L:
r.append(item) 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): if len(r):
# create IrcMsg # create IrcMsg
self._sendModes(irc,r,f) self._sendModes(irc,r,f)