3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

clientbot: fix oper tracking, add deoper tracking

Closes #289.
This commit is contained in:
James Lu 2016-07-29 00:54:47 -07:00
parent 6bc3191077
commit 3ad9362247

View File

@ -418,8 +418,12 @@ class ClientbotWrapperProtocol(Protocol):
if '*' in status: # Track IRCop status
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'}])
#else: # TODO: track de-opers as well
elif self.irc.isOper(uid, allowAuthed=False) and not self.irc.isInternalClient(uid):
# Track deopers
self.irc.applyModes(uid, [('-o', None)])
self.irc.callHooks([uid, 'MODE', {'target': uid, 'modes': {('-o', None)}}])
self.who_received.add(uid)