Skip to content
Snippets Groups Projects
Commit 1f320833 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

fix XML -> PubSub transition for bookmarks when bookmarks node doesn't exist

parent f501c2c4
No related branches found
No related tags found
No related merge requests found
......@@ -2765,6 +2765,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
con.RegisterHandler('iq', self._PrivacySetCB, 'set',
common.xmpp.NS_PRIVACY)
con.RegisterHandler('iq', self._PubSubCB, 'result')
con.RegisterHandler('iq', self._PubSubErrorCB, 'error')
con.RegisterHandler('iq', self._ErrorCB, 'error')
con.RegisterHandler('iq', self._IqCB)
con.RegisterHandler('iq', self._StanzaArrivedCB)
......
......@@ -166,6 +166,18 @@ class ConnectionPubSub:
if ns == 'storage:bookmarks':
self._parse_bookmarks(storage, 'pubsub')
def _PubSubErrorCB(self, conn, stanza):
gajim.log.debug('_PubsubErrorCB')
pubsub = stanza.getTag('pubsub')
if not pubsub:
return
items = pubsub.getTag('items')
if not items:
return
if items.getAttr('node') == 'storage:bookmarks':
# Receiving bookmarks from pubsub failed, so take them from xml
self.get_bookmarks(storage_type='xml')
def request_pb_configuration(self, jid, node):
if not self.connection or self.connected < 2:
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment