Merge branch 'fix-synchronise-rooms' into 'master'

Only add autojoin to a bookmark on creation if the room is not bookmarked

See merge request poezio/poezio!131
This commit is contained in:
Maxime Buquet 2020-05-28 00:35:30 +02:00
commit 1b8618d690
3 changed files with 3 additions and 2 deletions

View file

@ -11,6 +11,7 @@ https://dev.louiz.org/projects/poezio/roadmap
- Contacts wont be seen playing games or music when they actually stop doing - Contacts wont be seen playing games or music when they actually stop doing
so. so.
- /leave now toggles off the autojoin flag instead of removing the bookmark. - /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, - /affiliation displays things in the info win instead of directly in the room,
and additionally displays which room it refers to. and additionally displays which room it refers to.
- List the correct required versions for package maintainers. - List the correct required versions for package maintainers.

View file

@ -171,7 +171,7 @@ class BookmarkList:
return self.bookmarks[key] return self.bookmarks[key]
return None return None
def __in__(self, key) -> bool: def __contains__(self, key) -> bool:
if isinstance(key, (str, JID)): if isinstance(key, (str, JID)):
for bookmark in self.bookmarks: for bookmark in self.bookmarks:
if bookmark.jid == key: if bookmark.jid == key:

View file

@ -401,7 +401,7 @@ class CommandCore:
tab.password = password tab.password = password
tab.join() 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( method = 'remote' if config.get(
'use_remote_bookmarks') else 'local' 'use_remote_bookmarks') else 'local'
self._add_bookmark('%s/%s' % (room, nick), True, password, method) self._add_bookmark('%s/%s' % (room, nick), True, password, method)