~nicoco/public-inbox

Signal: fix missing profile.name handling v2 APPLIED

Rex Roni: 1
 Signal: fix missing profile.name handling

 1 files changed, 3 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~nicoco/public-inbox/patches/34333/mbox | git am -3
Learn more about email & git

[PATCH v2] Signal: fix missing profile.name handling Export this patch

Bug introduced in 29df2273: if profile.name is None, an exception would
be raised before falling back to profile.profile_name.
---
 slidge/plugins/signal/session.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/slidge/plugins/signal/session.py b/slidge/plugins/signal/session.py
index deec944..dd551ed 100644
--- a/slidge/plugins/signal/session.py
+++ b/slidge/plugins/signal/session.py
@@ -150,9 +150,9 @@ class Session(BaseSession["Contact", "Roster", "Gateway"]):
            )
            contact = self.contacts.by_phone(profile.address.number)
            contact.uuid = profile.address.uuid
            contact.name = profile.name.replace(
                "\u0000", " "
            ) or profile.profile_name.replace("\u0000", " ")
            contact.name = profile.name or profile.profile_name
            if contact.name is not None:
                contact.name = contact.name.replace("\u0000", "")
            if full_profile.avatar is not None:
                with open(full_profile.avatar, "rb") as f:
                    contact.avatar = f.read()
--
2.37.1