Selaa lähdekoodia

Try to use contact avatars if contact names are allowed

Tulir Asokan 4 vuotta sitten
vanhempi
sitoutus
996b0139b5
2 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 1 0
      mausignald/types.py
  2. 2 0
      mautrix_signal/puppet.py

+ 1 - 0
mausignald/types.py

@@ -291,6 +291,7 @@ class ReceiptType(SerializableEnum):
     UNKNOWN = "UNKNOWN"
     DELIVERY = "DELIVERY"
     READ = "READ"
+    VIEWED = "VIEWED"
 
 
 @dataclass

+ 2 - 0
mautrix_signal/puppet.py

@@ -180,6 +180,8 @@ class Puppet(DBPuppet, BasePuppet):
                 update = await self._update_name(name) or update
             if isinstance(info, Profile):
                 update = await self._update_avatar(info.avatar) or update
+            elif contact_names != "disallow" and self.number:
+                update = await self._update_avatar(f"contact-{self.number}") or update
             if update:
                 await self.update()
                 asyncio.create_task(self._update_portal_meta())