[Link Mauve] fix for bookmarks(XEP-0048)

This commit is contained in:
Denis Fomin 2011-01-03 21:41:17 +03:00
parent 33b2ae1108
commit 8ed33a3227
2 changed files with 8 additions and 1 deletions

View File

@ -461,7 +461,13 @@ class PrivateStorageReceivedEvent(nec.NetworkIncomingEvent):
class BookmarksHelper:
def parse_bookmarks(self):
self.bookmarks = []
confs = self.base_event.storage_node.getTags('conference')
try:
storage = self.base_event.item_node.getTag('storage',
namespace=xmpp.NS_BOOKMARKS)
except AttributeError:
storage = self.base_event.storage_node
confs = storage.getTags('conference')
for conf in confs:
autojoin_val = conf.getAttr('autojoin')
if autojoin_val is None: # not there (it's optional)

View File

@ -38,6 +38,7 @@ NS_AUTH ='jabber:iq:auth'
NS_AVATAR ='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'
NS_BIND ='urn:ietf:params:xml:ns:xmpp-bind'
NS_BOB ='urn:xmpp:bob' #XEP-0231
NS_BOOKMARKS ='storage:bookmarks' #XEP-0048
NS_BROWSE ='jabber:iq:browse'
NS_BROWSING ='http://jabber.org/protocol/browsing' # XEP-0195
NS_BYTESTREAM ='http://jabber.org/protocol/bytestreams' # JEP-0065