Philipp Hörist pushed to branch master at gajim / gajim


Commits:
32dba67b by Philipp Hörist at 2025-11-01T12:15:13+01:00
cfix: VCard4: Request own vcard at start

Some servers e.g. ejabberd do not send us the last published item
when we subscribe.

- - - - -


1 changed file:

- gajim/common/modules/vcard4.py


Changes:

=====================================
gajim/common/modules/vcard4.py
=====================================
@@ -75,6 +75,15 @@ def subscribe_to_node(self) -> None:
         self._log.info("Subscribe to node")
         self._client.get_module('PubSub').subscribe(Namespace.VCARD4_PUBSUB)
 
+        jid = self._get_own_bare_jid()
+
+        self._nbxmpp('VCard4').request_vcard(
+            jid,
+            timeout=10,
+            callback=self._on_vcard_received,
+            user_data=(jid, None),
+        )
+
     def get_own_vcard(self) -> VCard:
         return self._own_vcard
 
@@ -123,6 +132,13 @@ def _on_vcard_received(self, task: Task) -> None:
             self._log.info('Received VCard for %s', jid)
             self._vcard_cache[jid] = (time.time(), vcard)
 
+        if jid.bare_match(self._get_own_bare_jid()):
+            self._own_vcard = vcard
+            app.ged.raise_event(VCard4Received(self._account, self._own_vcard))
+
+        if weak_callable is None:
+            return
+
         callback = weak_callable()
         if callback is None:
             return



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/32dba67b55b07c72239485ef00eb50260b5f163d

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/32dba67b55b07c72239485ef00eb50260b5f163d
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to