From 4cb852914ea049b2002ae0a9bf1126e16891604c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Thu, 12 Jul 2018 21:33:34 +0200 Subject: [PATCH] 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 --- gajim/common/modules/bookmarks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gajim/common/modules/bookmarks.py b/gajim/common/modules/bookmarks.py index 9b85588e3..bdd0dc982 100644 --- a/gajim/common/modules/bookmarks.py +++ b/gajim/common/modules/bookmarks.py @@ -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)