From 7b2f93fd4c471b34896373dd1cdcd87638365221 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 3 Jul 2017 14:24:17 -0700 Subject: [PATCH] ngircd: send an UID hook in user introductions --- protocols/ngircd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/protocols/ngircd.py b/protocols/ngircd.py index 0d9c61d..e354645 100644 --- a/protocols/ngircd.py +++ b/protocols/ngircd.py @@ -150,11 +150,14 @@ class NgIRCdProtocol(IRCS2SProtocol): uid = self.uidgen.next_uid(prefix=nick) realname = args[-1] - self.users[uid] = User(nick, int(time.time()), uid, source, ident=ident, host=host, - realname=realname) + ts = int(time.time()) + self.users[uid] = User(nick, ts, uid, source, ident=ident, host=host, realname=realname) parsedmodes = self.parse_modes(uid, [args[5]]) self.apply_modes(uid, parsedmodes) + return {'uid': uid, 'ts': ts, 'nick': nick, 'realhost': host, 'host': host, 'ident': ident, + 'parse_as': 'UID', 'ip': '0.0.0.0'} + def handle_ping(self, source, command, args): if source == self.uplink: # Note: SID = server name here