Fix bookmarks strategy

Strategy is now:

1. Get pubsub if supported
2. Get private storage and merge if we find boomarks we dont have
3. Store bookmarks to both pubsub and privatestorage

The only drawback with this strategy is, that a client that supports
only private storage cant delete bookmarks
This commit is contained in:
Philipp Hörist 2018-07-12 21:33:34 +02:00
parent c3a359ba23
commit 4cb852914e
1 changed files with 4 additions and 4 deletions

View File

@ -160,8 +160,9 @@ class Bookmarks:
continue
if check_merge:
if jid not in self.bookmarks:
merged = True
if jid in self.bookmarks:
continue
merged = True
log.debug('Found Bookmark: %s', jid)
self.bookmarks[jid] = {
@ -218,8 +219,7 @@ class Bookmarks:
if storage_type is None:
if self._pubsub_support():
self._pubsub_store(storage_node)
else:
self._private_store(storage_node)
self._private_store(storage_node)
elif storage_type == BookmarkStorageType.PUBSUB:
if self._pubsub_support():
self._pubsub_store(storage_node)