From f9a692b5efd34799750275ea56cb8d67bc31f378 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 27 Oct 2019 18:08:19 +0200 Subject: [PATCH] Telegram now allows custom contact names without knowing the phone number, so stop trusting those names --- mautrix_telegram/puppet.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mautrix_telegram/puppet.py b/mautrix_telegram/puppet.py index cb53d753..6723c321 100644 --- a/mautrix_telegram/puppet.py +++ b/mautrix_telegram/puppet.py @@ -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):