Commit 62253c80 authored by Philipp Hörist's avatar Philipp Hörist

Discover the bookmarks conversion server feature

parent c2e2dd9a
Pipeline #2763 passed with stages
in 3 minutes and 48 seconds
......@@ -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 = {}
......
......@@ -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:
......
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment