Explorar o código

Fall back to profile name even when preferring contact list names

Tulir Asokan %!s(int64=4) %!d(string=hai) anos
pai
achega
4f3c449882
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      mautrix_signal/puppet.py

+ 3 - 0
mautrix_signal/puppet.py

@@ -168,6 +168,9 @@ class Puppet(DBPuppet, BasePuppet):
             name = info.profile_name
         elif isinstance(info, (Contact, Profile)) and contact_names != "disallow":
             name = info.name
+            if not name and isinstance(info, Profile) and info.profile_name:
+                # Contact list name is preferred, but was not found, fall back to profile
+                name = info.profile_name
         else:
             name = None