From deddbde2b081077920c1f4937023b9fe69980e12 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 21 Jul 2016 18:35:57 -0700 Subject: [PATCH] clientbot: implement updateClient for tracking client ident/host --- protocols/clientbot.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 858a2e6..8c5e473 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -176,6 +176,17 @@ class ClientbotWrapperProtocol(Protocol): return kill = away = mode = topic = topicBurst = knock = updateClient = numeric = _stub + def updateClient(self, target, field, text): + """Updates the known ident, host, or realname of a client.""" + if field == 'IDENT': + self.irc.users[target].ident = text + elif field == 'HOST': + self.irc.users[target].host = text + elif field in ('REALNAME', 'GECOS'): + self.irc.users[target].realname = text + else: + raise NotImplementedError + def handle_events(self, data): """Event handler for the RFC1459/2812 (clientbot) protocol.""" data = data.split(" ")