Verified Commit 2583b6a9 authored by mathieui's avatar mathieui

Add a force_remote_bookmarks option

parent 60231c27
......@@ -127,6 +127,10 @@ use_bookmarks_method =
# possible values are: anything/false
use_remote_bookmarks = true
# Force the retrieval of the remote bookmarks even when the server
# doesn't advertise support for your method
force_remote_bookmarks = false
# Whether you want all bookmarks, even those without
# autojoin, to be open on startup
open_all_bookmarks = false
......@@ -348,6 +348,14 @@ to understand what is :ref:`carbons <carbons-details>` or
sender intended it as such. See :ref:`Message Correction <correct-feature>` for
more information.
**Default value:** ``false``
Try to retrieve your remote bookmarks, even when your server doesn’t advertise
**Default value:** ``[empty]``
......@@ -243,13 +243,26 @@ class BookmarkList(object):
def get_remote(self, xmpp, information, callback):
"""Add the remotely stored bookmarks to the list."""
if xmpp.anon or not any(self.available_storage.values()):
force = config.get('force_remote_bookmarks')
if xmpp.anon or not (any(self.available_storage.values()) or force):
information(_('No remote bookmark storage available'), 'Warning')
if self.preferred == 'privatexml':
self.get_privatexml(xmpp, callback=callback)
if force and not any(self.available_storage.values()):
old_callback = callback
method = 'pep' if self.preferred == 'pep' else 'privatexml'
def new_callback(result):
if result['type'] != 'error':
self.available_storage[method] = True
information(_('No remote bookmark storage available'), 'Warning')
callback = new_callback
if self.preferred == 'pep':
self.get_pep(xmpp, callback=callback)
self.get_privatexml(xmpp, callback=callback)
def get_local(self):
"""Add the locally stored bookmarks to the list."""
......@@ -62,6 +62,7 @@ DEFAULT_CONFIG = {
'extract_inline_images': True,
'filter_info_messages': '',
'force_encryption': True,
'force_remote_bookmarks': False,
'go_to_previous_tab_on_alt_number': False,
'group_corrections': True,
'hide_exit_join': -1,
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