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

unreal: add updateClient

This commit is contained in:
James Lu 2015-11-15 09:45:46 -08:00
parent e167be2a69
commit 7e8e8f33f7

View File

@ -205,6 +205,22 @@ class UnrealProtocol(TS6BaseProtocol):
self.irc.channels[target].topic = text
self.irc.channels[target].topicset = True
def updateClient(self, numeric, field, text):
"""Updates the ident, host, or realname of a PyLink client."""
field = field.upper()
if field == 'IDENT':
self.irc.users[numeric].ident = text
self._send(numeric, 'SETIDENT %s' % text)
elif field == 'HOST':
self.irc.users[numeric].host = text
self._send(numeric, 'SETHOST %s' % text)
elif field in ('REALNAME', 'GECOS'):
self.irc.users[numeric].realname = text
self._send(numeric, 'SETNAME :%s' % text)
else:
raise NotImplementedError("Changing field %r of a client is unsupported by this protocol." % field)
### HANDLERS
def connect(self):