Set a user's username/hostname/account BEFORE sending a received.join

This commit is contained in:
jesopo 2019-03-06 15:51:10 +00:00
parent c876940443
commit 1dad4827b6

View file

@ -66,6 +66,14 @@ def join(events, event):
user = event["server"].get_user(event["prefix"].nickname)
user.username = event["prefix"].username
user.hostname = event["prefix"].hostname
if account:
user.identified_account = account
user.identified_account_id = event["server"].get_user(account).get_id()
if realname:
user.realname = realname
if event["server"].is_own_nickname(event["prefix"].nickname):
channel = event["server"].channels.add(channel_name)
if channel.name in event["server"].attempted_join:
@ -78,15 +86,6 @@ def join(events, event):
events.on("received.join").call(channel=channel, user=user,
server=event["server"], account=account, realname=realname)
user.username = event["prefix"].username
user.hostname = event["prefix"].hostname
if account:
user.identified_account = account
user.identified_account_id = event["server"].get_user(account).get_id()
if realname:
user.realname = realname
channel.add_user(user)
user.join_channel(channel)