3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-23 10:44:09 +01:00

clientbot: don't send duplicate operups (#289)

This commit is contained in:
James Lu 2016-07-29 00:56:14 -07:00
parent 3ad9362247
commit 2bc066bacb

View File

@ -417,9 +417,11 @@ class ClientbotWrapperProtocol(Protocol):
log.warning('(%s) handle_352: got wrong string %s for away status', self.irc.name, status[0]) log.warning('(%s) handle_352: got wrong string %s for away status', self.irc.name, status[0])
if '*' in status: # Track IRCop status if '*' in status: # Track IRCop status
self.irc.applyModes(uid, [('+o', None)]) if not self.irc.isOper(uid, allowAuthed=False):
self.irc.callHooks([uid, 'MODE', {'target': uid, 'modes': {('+o', None)}}]) # Don't send duplicate oper ups if the target is already oper.
self.irc.callHooks([uid, 'CLIENT_OPERED', {'text': 'IRC Operator'}]) self.irc.applyModes(uid, [('+o', None)])
self.irc.callHooks([uid, 'MODE', {'target': uid, 'modes': {('+o', None)}}])
self.irc.callHooks([uid, 'CLIENT_OPERED', {'text': 'IRC Operator'}])
elif self.irc.isOper(uid, allowAuthed=False) and not self.irc.isInternalClient(uid): elif self.irc.isOper(uid, allowAuthed=False) and not self.irc.isInternalClient(uid):
# Track deopers # Track deopers
self.irc.applyModes(uid, [('-o', None)]) self.irc.applyModes(uid, [('-o', None)])