diff options
author | Marvin W <git@larma.de> | 2018-01-12 21:13:46 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2018-01-28 00:38:47 +0100 |
commit | bbfac9115500405095210f046dbccef913d03e04 (patch) | |
tree | d8cce86ecf58e4cf9a0a3e5bc7192df0c12f1e94 /libdino/src/service/muc_manager.vala | |
parent | 782ae4c049e2b6fab13d7453cbb0e74610e7d200 (diff) | |
download | dino-bbfac9115500405095210f046dbccef913d03e04.tar.gz dino-bbfac9115500405095210f046dbccef913d03e04.zip |
Fix certain Slack specific issues (using host-based workarounds)
Diffstat (limited to 'libdino/src/service/muc_manager.vala')
-rw-r--r-- | libdino/src/service/muc_manager.vala | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index 4689bdcf..23c234a4 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -226,9 +226,13 @@ public class MucManager : StreamInteractionModule, Object { private void on_stream_negotiated(Account account, XmppStream stream) { stream.get_module(Xep.Bookmarks.Module.IDENTITY).get_conferences(stream, (stream, conferences) => { - foreach (Xep.Bookmarks.Conference bookmark in conferences) { - if (bookmark.autojoin) { - join(account, bookmark.jid, bookmark.nick, bookmark.password); + if (conferences == null) { + join_all_active(account); + } else { + foreach (Xep.Bookmarks.Conference bookmark in conferences) { + if (bookmark.autojoin) { + join(account, bookmark.jid, bookmark.nick, bookmark.password); + } } } }); @@ -255,6 +259,15 @@ public class MucManager : StreamInteractionModule, Object { } } + private void join_all_active(Account account) { + Gee.List<Conversation> conversations = stream_interactor.get_module(ConversationManager.IDENTITY).get_active_conversations(account); + foreach (Conversation conversation in conversations) { + if (conversation.type_ == Conversation.Type.GROUPCHAT && conversation.nickname != null) { + join(account, conversation.counterpart, conversation.nickname, null); + } + } + } + private void sync_autojoin_active(Account account, Gee.List<Xep.Bookmarks.Conference> conferences) { Gee.List<Conversation> conversations = stream_interactor.get_module(ConversationManager.IDENTITY).get_active_conversations(account); leave_non_autojoin(account, conferences, conversations); |