fix XML -> PubSub transition for bookmarks when bookmarks node doesn't exist
This commit is contained in:
parent
f501c2c4fe
commit
1f32083334
|
@ -2765,6 +2765,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
||||||
con.RegisterHandler('iq', self._PrivacySetCB, 'set',
|
con.RegisterHandler('iq', self._PrivacySetCB, 'set',
|
||||||
common.xmpp.NS_PRIVACY)
|
common.xmpp.NS_PRIVACY)
|
||||||
con.RegisterHandler('iq', self._PubSubCB, 'result')
|
con.RegisterHandler('iq', self._PubSubCB, 'result')
|
||||||
|
con.RegisterHandler('iq', self._PubSubErrorCB, 'error')
|
||||||
con.RegisterHandler('iq', self._ErrorCB, 'error')
|
con.RegisterHandler('iq', self._ErrorCB, 'error')
|
||||||
con.RegisterHandler('iq', self._IqCB)
|
con.RegisterHandler('iq', self._IqCB)
|
||||||
con.RegisterHandler('iq', self._StanzaArrivedCB)
|
con.RegisterHandler('iq', self._StanzaArrivedCB)
|
||||||
|
|
|
@ -166,6 +166,18 @@ class ConnectionPubSub:
|
||||||
if ns == 'storage:bookmarks':
|
if ns == 'storage:bookmarks':
|
||||||
self._parse_bookmarks(storage, 'pubsub')
|
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):
|
def request_pb_configuration(self, jid, node):
|
||||||
if not self.connection or self.connected < 2:
|
if not self.connection or self.connected < 2:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue