Discover the bookmarks conversion server feature

This commit is contained in:
Philipp Hörist 2018-12-04 20:41:30 +01:00
parent c2e2dd9a87
commit 62253c804a
3 changed files with 11 additions and 1 deletions

View File

@ -37,10 +37,17 @@ class Bookmarks:
self._con = con
self._account = con.name
self.bookmarks = {}
self.conversion = False
self.available = False
self.handlers = []
def pass_disco(self, from_, _identities, features, _data, _node):
if nbxmpp.NS_BOOKMARK_CONVERSION not in features:
return
self.conversion = True
log.info('Discovered Bookmarks Conversion: %s', from_)
def get_sorted_bookmarks(self, short_name=False):
# This returns a sorted by name copy of the bookmarks
sorted_bookmarks = {}

View File

@ -177,6 +177,7 @@ class Discovery:
self._con.get_module('MAM').pass_disco(from_, *args)
self._con.get_module('PEP').pass_disco(from_, *args)
self._con.get_module('PubSub').pass_disco(from_, *args)
self._con.get_module('Bookmarks').pass_disco(from_, *args)
features = args[1]
if 'urn:xmpp:pep-vcard-conversion:0' in features:

View File

@ -191,7 +191,9 @@ class ServerInfoDialog(Gtk.Dialog):
con.get_module('HTTPUpload').available,
con.get_module('HTTPUpload').httpupload_namespace, None),
Feature('XEP-0398: Avatar Conversion',
con.avatar_conversion, '', None)
con.avatar_conversion, '', None),
Feature('XEP-0411: Bookmarks Conversion',
con.get_module('Bookmarks').conversion, '', None)
]
def add_info(self, info):