From e79e3f03150b4ac6ce8fb5cbb7388dd38103063e Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 3 Feb 2020 23:13:57 +0000 Subject: [PATCH] set username and hostmask on chghost before event dispatch --- src/core_modules/line_handler/user.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core_modules/line_handler/user.py b/src/core_modules/line_handler/user.py index 1d7ad016..15b71673 100644 --- a/src/core_modules/line_handler/user.py +++ b/src/core_modules/line_handler/user.py @@ -73,12 +73,15 @@ def chghost(events, event): event["server"].hostname = hostname target = event["server"].get_user(nickname) - events.on("received.chghost").call(user=target, server=event["server"], - username=username, hostname=hostname) + old_username = target.username + old_hostname = target.hostname target.username = username target.hostname = hostname + events.on("received.chghost").call(user=target, server=event["server"], + old_username=old_username, old_hostname=old_hostname) + def setname(event): nickname = event["line"].source.nickname realname = event["line"].args[0]