From ac281533f5ea99c36fa5d9adc35be4c13aa77e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 13 Oct 2017 22:53:28 +0200 Subject: [PATCH] Get Pubsub bookmarks also if PEP is supported --- gajim/common/connection.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/gajim/common/connection.py b/gajim/common/connection.py index b697ce7b9..4d683edcf 100644 --- a/gajim/common/connection.py +++ b/gajim/common/connection.py @@ -2362,15 +2362,18 @@ class Connection(CommonConnection, ConnectionHandlers): """ if not app.account_is_connected(self.name): return - if self.pubsub_supported and self.pubsub_publish_options_supported \ - and storage_type != 'xml': - self.send_pb_retrieve('', 'storage:bookmarks') - app.log('bookmarks').info('Request Bookmarks (PubSub)') - # some server (ejabberd) are so slow to answer that we request via XML - # if we don't get answer in the next 30 seconds - app.idlequeue.set_alarm(self._check_bookmarks_received, 30) - else: - self._request_bookmarks_xml() + + if storage_type != 'xml': + pubsub = self.pubsub_supported or self.pep_supported + if pubsub and self.pubsub_publish_options_supported: + self.send_pb_retrieve('', 'storage:bookmarks') + app.log('bookmarks').info('Request Bookmarks (PubSub)') + # some server (ejabberd) are so slow to answer that we + # request via XML if we don't get answer in the next 30 seconds + app.idlequeue.set_alarm(self._check_bookmarks_received, 30) + return + + self._request_bookmarks_xml() def get_bookmarks_storage_node(self): NS_GAJIM_BM = 'xmpp:gajim.org/bookmarks' @@ -2423,7 +2426,8 @@ class Connection(CommonConnection, ConnectionHandlers): storage_node = self.get_bookmarks_storage_node() if storage_type != 'xml': - if self.pubsub_supported and self.pubsub_publish_options_supported: + pubsub = self.pubsub_supported or self.pep_supported + if pubsub and self.pubsub_publish_options_supported: self.send_pb_publish( '', 'storage:bookmarks', storage_node, 'current', options=self.get_bookmark_publish_options())