plugins XEP-0048, XEP-0049: feature is not checked anymore before using private XML storage, as feature announcement is not mandatory in XEP-0049

This commit is contained in:
Goffi 2014-04-10 16:12:50 +02:00
commit 3fcd7e22d9

View file

@ -25,6 +25,7 @@ from sat.tools import xml_tools
from logging import debug, info, warning, error
from twisted.words.xish import domish
from twisted.words.protocols.jabber import jid
from twisted.words.protocols.jabber.error import StanzaError
from twisted.internet import defer
@ -98,15 +99,13 @@ class XEP_0048(object):
- 'pubsub': XEP-0223 storage
@param profile: %(doc_profile)s
@return: data dictionary, or None if feature is not available
@raise: exception.FeatureNotFound
"""
client = self.host.getClient(profile)
if storage_type == 'private':
try:
bookmarks_private_xml = yield self.private_plg.privateXMLGet('storage', NS_BOOKMARKS, profile)
data = client.bookmarks_private = self._bookmarkElt2Dict(bookmarks_private_xml)
except (exceptions.FeatureNotFound, AttributeError):
except (StanzaError, AttributeError):
info(_("Private XML storage not available"))
data = client.bookmarks_private = None
elif storage_type == 'pubsub':