Set a user's username/hostname/account BEFORE sending a received.join
This commit is contained in:
parent
c876940443
commit
1dad4827b6
1 changed files with 8 additions and 9 deletions
|
@ -66,6 +66,14 @@ def join(events, event):
|
||||||
|
|
||||||
user = event["server"].get_user(event["prefix"].nickname)
|
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):
|
if event["server"].is_own_nickname(event["prefix"].nickname):
|
||||||
channel = event["server"].channels.add(channel_name)
|
channel = event["server"].channels.add(channel_name)
|
||||||
if channel.name in event["server"].attempted_join:
|
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,
|
events.on("received.join").call(channel=channel, user=user,
|
||||||
server=event["server"], account=account, realname=realname)
|
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)
|
channel.add_user(user)
|
||||||
user.join_channel(channel)
|
user.join_channel(channel)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue