mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-30 12:24:52 +00:00
Pyrofork: types: {chat,user}: Use first fragments username as normal username if normal username is None
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
348d6173cd
commit
5ea55040f8
2 changed files with 6 additions and 0 deletions
|
|
@ -307,6 +307,9 @@ class Chat(Object):
|
|||
user_name = username.username
|
||||
else:
|
||||
usernames.append(types.Username._parse(username))
|
||||
if user_name is None and usernames is not None and len(usernames) > 0:
|
||||
user_name = usernames[0].username
|
||||
usernames.pop(0)
|
||||
|
||||
return Chat(
|
||||
id=peer_id,
|
||||
|
|
|
|||
|
|
@ -249,6 +249,9 @@ class User(Object, Update):
|
|||
user_name = username.username
|
||||
else:
|
||||
usernames.append(types.Username._parse(username))
|
||||
if user_name is None and usernames is not None and len(usernames) > 0:
|
||||
user_name = usernames[0].username
|
||||
usernames.pop(0)
|
||||
|
||||
return User(
|
||||
id=user.id,
|
||||
|
|
|
|||
Loading…
Reference in a new issue