Просмотр исходного кода

Fall back to profile name even when preferring contact list names

Tulir Asokan 4 лет назад
Родитель
Сommit
4f3c449882
1 измененных файлов с 3 добавлено и 0 удалено
  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