mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04:51 +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
|
user_name = username.username
|
||||||
else:
|
else:
|
||||||
usernames.append(types.Username._parse(username))
|
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(
|
return Chat(
|
||||||
id=peer_id,
|
id=peer_id,
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,9 @@ class User(Object, Update):
|
||||||
user_name = username.username
|
user_name = username.username
|
||||||
else:
|
else:
|
||||||
usernames.append(types.Username._parse(username))
|
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(
|
return User(
|
||||||
id=user.id,
|
id=user.id,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue