From 9e3958c67d2e7d16a069b50ef2e76d92280b6584 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 28 May 2020 00:28:23 +0200 Subject: Only add autojoin to a bookmark on creation if the room is not bookmarked With synchronise_open_rooms, otherwise you just have autojoin added everytime, which is probably not what you want. --- poezio/bookmarks.py | 2 +- poezio/core/commands.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'poezio') diff --git a/poezio/bookmarks.py b/poezio/bookmarks.py index ccda2b93..d842d2dd 100644 --- a/poezio/bookmarks.py +++ b/poezio/bookmarks.py @@ -171,7 +171,7 @@ class BookmarkList: return self.bookmarks[key] return None - def __in__(self, key) -> bool: + def __contains__(self, key) -> bool: if isinstance(key, (str, JID)): for bookmark in self.bookmarks: if bookmark.jid == key: diff --git a/poezio/core/commands.py b/poezio/core/commands.py index 176d0e73..6fc800ae 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -401,7 +401,7 @@ class CommandCore: tab.password = password tab.join() - if config.get('synchronise_open_rooms'): + if config.get('synchronise_open_rooms') and room not in self.core.bookmarks: method = 'remote' if config.get( 'use_remote_bookmarks') else 'local' self._add_bookmark('%s/%s' % (room, nick), True, password, method) -- cgit v1.2.3