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

clientbot: send hook payloads for external updateClient

Closes #300.
This commit is contained in:
James Lu 2016-08-12 18:38:23 -07:00
parent 6828d032b4
commit 17127dd131

View File

@ -252,10 +252,21 @@ class ClientbotWrapperProtocol(Protocol):
"""Updates the known ident, host, or realname of a client."""
if field == 'IDENT':
self.irc.users[target].ident = text
if not self.irc.isInternalClient(target):
# We're updating the host of an external client in our state, so send the appropriate
# hook payloads.
self.irc.callHooks([self.irc.sid, 'CHGIDENT',
{'target': target, 'newident': text}])
elif field == 'HOST':
self.irc.users[target].host = text
if not self.irc.isInternalClient(target):
self.irc.callHooks([self.irc.sid, 'CHGHOST',
{'target': target, 'newhost': text}])
elif field in ('REALNAME', 'GECOS'):
self.irc.users[target].realname = text
if not self.irc.isInternalClient(target):
self.irc.callHooks([self.irc.sid, 'CHGNAME',
{'target': target, 'newgecos': text}])
else:
raise NotImplementedError