Allow displayname updates if ghost user has no name
This commit is contained in:
@@ -589,6 +589,9 @@ class PortalTelegram(BasePortal, ABC):
|
|||||||
"displayname, updating info...")
|
"displayname, updating info...")
|
||||||
entity = await source.client.get_entity(PeerUser(sender.tgid))
|
entity = await source.client.get_entity(PeerUser(sender.tgid))
|
||||||
await sender.update_info(source, entity)
|
await sender.update_info(source, entity)
|
||||||
|
if not sender.displayname:
|
||||||
|
self.log.debug(f"Telegram user {sender.tgid} doesn't have a displayname even after"
|
||||||
|
f" updating with data {entity!s}")
|
||||||
|
|
||||||
allowed_media = (MessageMediaPhoto, MessageMediaDocument, MessageMediaGeo,
|
allowed_media = (MessageMediaPhoto, MessageMediaDocument, MessageMediaGeo,
|
||||||
MessageMediaGame, MessageMediaDice, MessageMediaPoll,
|
MessageMediaGame, MessageMediaDice, MessageMediaPoll,
|
||||||
|
|||||||
@@ -270,8 +270,10 @@ class Puppet(BasePuppet):
|
|||||||
allow_because = "user is the primary source"
|
allow_because = "user is the primary source"
|
||||||
elif not isinstance(info, UpdateUserName) and not info.contact:
|
elif not isinstance(info, UpdateUserName) and not info.contact:
|
||||||
allow_because = "user is not a contact"
|
allow_because = "user is not a contact"
|
||||||
elif self.displayname_source is None:
|
elif not self.displayname_source:
|
||||||
allow_because = "no primary source set"
|
allow_because = "no primary source set"
|
||||||
|
elif not self.displayname:
|
||||||
|
allow_because = "user has no name"
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user