From ad166a7d0a5f37a2bd9c4325a87a407ec42a1852 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 2 Apr 2019 14:21:16 +0100 Subject: [PATCH] Correctly support SETNAME being targetted at us --- modules/line_handler/user.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/line_handler/user.py b/modules/line_handler/user.py index 4153fc1b..855ca7f6 100644 --- a/modules/line_handler/user.py +++ b/modules/line_handler/user.py @@ -78,8 +78,14 @@ def chghost(event): target.hostname = hostname def setname(event): - user = event["server"].get_user(event["prefix"].nickname) - user.realname = event["args"][0] + nickname = event["prefix"].nickname + realname = event["args"][0] + + user = event["server"].get_user(nickname) + user.realname = realname + + if event["server"].is_own_nickname(nickname): + event["server"].realname = realname def account(events, event): user = event["server"].get_user(event["prefix"].nickname)