From 4cc7781f0dbef1e963a0d480d4830d3cdfb37f35 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 6 Jul 2015 19:44:55 -0700 Subject: [PATCH] pr/insp: send oldnick in handle_nick hook Since hooks are only called after processing is done by the protocol module, plugins would have no way of knowing what the old nick of the user was. --- protocols/inspircd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 1036f96..a05a9ed 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -261,8 +261,9 @@ def handle_server(irc, numeric, command, args): def handle_nick(irc, numeric, command, args): # <- :70MAAAAAA NICK GL-devel 1434744242 - n = irc.users[numeric].nick = args[0] - return {'newnick': n, 'ts': args[1]} + oldnick = irc.users[numeric].nick + newnick = irc.users[numeric].nick = args[0] + return {'newnick': newnick, 'oldnick': oldnick, 'ts': args[1]} def handle_save(irc, numeric, command, args): # This is used to handle nick collisions. Here, the client Derp_ already exists,