diff options
Diffstat (limited to 'libdino/src/service/muc_manager.vala')
-rw-r--r-- | libdino/src/service/muc_manager.vala | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index f224a8ec..696f304c 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -208,10 +208,7 @@ public class MucManager : StreamInteractionModule, Object { private void on_account_added(Account account) { stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).room_entered.connect( (stream, jid, nick) => { - enter_errors.unset(jid); - set_autojoin(stream, jid, nick, null); // TODO password - joined(account, jid, nick); - stream_interactor.get_module(MessageProcessor.IDENTITY).send_unsent_messages(account, jid); + on_room_entred(account, stream, jid, nick); }); stream_interactor.module_manager.get_module(account, Xep.Muc.Module.IDENTITY).room_enter_error.connect( (stream, jid, error) => { enter_errors[jid] = error; @@ -243,6 +240,16 @@ public class MucManager : StreamInteractionModule, Object { }); } + private void on_room_entred(Account account, XmppStream stream, Jid jid, string nick) { + enter_errors.unset(jid); + set_autojoin(stream, jid, nick, null); // TODO password + joined(account, jid, nick); + stream_interactor.get_module(MessageProcessor.IDENTITY).send_unsent_messages(account, jid); + Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(jid, account, Conversation.Type.GROUPCHAT); + stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation); + conversation.nickname = nick; + } + 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) { |