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...")
|
||||
entity = await source.client.get_entity(PeerUser(sender.tgid))
|
||||
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,
|
||||
MessageMediaGame, MessageMediaDice, MessageMediaPoll,
|
||||
|
||||
@@ -270,8 +270,10 @@ class Puppet(BasePuppet):
|
||||
allow_because = "user is the primary source"
|
||||
elif not isinstance(info, UpdateUserName) and not info.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"
|
||||
elif not self.displayname:
|
||||
allow_because = "user has no name"
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user