From 64d3bf63cf95fc42602bc43dbb984f8e7739b306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sun, 15 Oct 2017 00:52:34 +0200 Subject: [PATCH] Discover PEP on the account jid see: https://xmpp.org/extensions/xep-0163.html#support --- gajim/common/connection.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/gajim/common/connection.py b/gajim/common/connection.py index b26bfc19b..f21e4af79 100644 --- a/gajim/common/connection.py +++ b/gajim/common/connection.py @@ -1914,15 +1914,20 @@ class Connection(CommonConnection, ConnectionHandlers): self.archiving_supported = True self.archiving_313_supported = True get_action(self.name + '-archive').set_enabled(True) + for identity in obj.identities: + if identity['category'] == 'pubsub': + self.pep_supported = identity.get('type') == 'pep' + break + if nbxmpp.NS_PUBSUB_PUBLISH_OPTIONS in obj.features: + self.pubsub_publish_options_supported = True + else: + # Remove stored bookmarks accessible to everyone. + self.send_pb_purge(our_jid, 'storage:bookmarks') + self.send_pb_delete(our_jid, 'storage:bookmarks') if obj.fjid == hostname: if nbxmpp.NS_SECLABEL in obj.features: self.seclabel_supported = True - for identity in obj.identities: - if identity['category'] == 'pubsub' and identity.get( - 'type') == 'pep': - self.pep_supported = True - break if nbxmpp.NS_VCARD in obj.features: self.vcard_supported = True get_action(self.name + '-profile').set_enabled(True) @@ -1930,12 +1935,6 @@ class Connection(CommonConnection, ConnectionHandlers): self.register_supported = True if nbxmpp.NS_PUBSUB in obj.features: self.pubsub_supported = True - if nbxmpp.NS_PUBSUB_PUBLISH_OPTIONS in obj.features: - self.pubsub_publish_options_supported = True - else: - # Remove stored bookmarks accessible to everyone. - self.send_pb_purge(our_jid, 'storage:bookmarks') - self.send_pb_delete(our_jid, 'storage:bookmarks') if nbxmpp.NS_BLOCKING in obj.features: self.blocking_supported = True if nbxmpp.NS_ADDRESS in obj.features: