set username and hostmask on chghost before event dispatch

This commit is contained in:
jesopo 2020-02-03 23:13:57 +00:00
parent 96a74747dc
commit e79e3f0315

View file

@ -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]