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


Commits:
9ab4618b by Philipp Hörist at 2026-05-03T13:45:14+02:00
new: Clear all pubsub public key nodes

- - - - -


1 changed file:

- gajim/common/modules/openpgp.py


Changes:

=====================================
gajim/common/modules/openpgp.py
=====================================
@@ -31,6 +31,7 @@
 from nbxmpp.namespaces import Namespace
 from nbxmpp.protocol import JID
 from nbxmpp.protocol import Message
+from nbxmpp.structs import DiscoItems
 from nbxmpp.structs import EncryptionData
 from nbxmpp.structs import MessageProperties
 from nbxmpp.structs import PGPKeyMetadata
@@ -1053,4 +1054,25 @@ def set_public_key_trust(
         )
 
     def clear_keylist(self) -> None:
+        self._client.get_module("Discovery").disco_items(
+            self._own_jid, callback=self._on_disco_items_result
+        )
+
+    def _on_disco_items_result(self, task: Task) -> None:
+        try:
+            result = cast(DiscoItems, task.finish())
+        except Exception as error:
+            self._log.warning("Disco items failed: %s", error)
+
+        else:
+            for item in result.items:
+                if item.node is None or not item.node.startswith(
+                    f"{Namespace.OPENPGP_PK}:"
+                ):
+                    continue
+                self._log.info("Remove pubsub node: %s", item.node)
+                self._client.get_module("PubSub").delete(item.node, 
self._own_jid)
+
+        if self.secret_key_exists():
+            self.set_public_key()
         self.set_keylist()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/9ab4618b9fed9a86810b2456ef95ad009cca0621

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/9ab4618b9fed9a86810b2456ef95ad009cca0621
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