Fix completely broken chghost code. What on god's earth was I thinking.

This commit is contained in:
jesopo 2019-02-13 10:56:52 +00:00
parent 1927c3c8af
commit 5b561b51f4

View file

@ -630,11 +630,12 @@ class Module(ModuleManager.BaseModule):
# IRCv3 CHGHOST, a user's username and/or hostname has changed # IRCv3 CHGHOST, a user's username and/or hostname has changed
@utils.hook("raw.received.chghost") @utils.hook("raw.received.chghost")
def chghost(self, event): def chghost(self, event):
nickname = event["prefix"].nickname
username = event["args"][0] username = event["args"][0]
hostname = event["args"][1] hostname = event["args"][1]
if not event["server"].is_own_nickname(event["prefix"].nickname): if not event["server"].is_own_nickname(nickname):
target = event["server"].get_user("nickanme") target = event["server"].get_user(nickname)
else: else:
target = event["server"] target = event["server"]
target.username = username target.username = username