Telegram now allows custom contact names without knowing the phone number, so stop trusting those names

This commit is contained in:
Tulir Asokan
2019-10-27 18:08:19 +02:00
parent 9205ef8024
commit f9a692b5ef
+1 -3
View File
@@ -259,9 +259,7 @@ class Puppet(CustomPuppetMixin):
allow_source = (source.is_relaybot
or self.displayname_source == source.tgid
# No displayname source, so just trust anything
or self.displayname_source is None
# No phone -> not in contact list -> can't set custom name
or (isinstance(info, User) and info.phone is None))
or self.displayname_source is None)
if not allow_source:
return False
elif isinstance(info, UpdateUserName):