Commit 9e3958c6 authored by mathieui's avatar mathieui

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.
parent 5cf90368
Pipeline #3224 passed with stages
in 5 minutes and 8 seconds
......@@ -11,6 +11,7 @@ https://dev.louiz.org/projects/poezio/roadmap
- Contacts won’t be seen playing games or music when they actually stop doing
so.
- /leave now toggles off the autojoin flag instead of removing the bookmark.
- Only add auotjoin on new bookmarks for synchronise_open_rooms on /join
- /affiliation displays things in the info win instead of directly in the room,
and additionally displays which room it refers to.
- List the correct required versions for package maintainers.
......
......@@ -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:
......
......@@ -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)
......
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