diff options
author | fiaxh <git@mx.ax.lt> | 2018-01-26 20:35:29 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2018-01-28 20:32:54 +0100 |
commit | bec810e234a7b9783eb8f35e2ffd7c60d75e09c7 (patch) | |
tree | 48ad4e1425920e9865a7db13b881cb7cd3308e86 /libdino/src/service | |
parent | 57c72d2818dec6c713834cfbb8c4c566a1602907 (diff) | |
download | dino-bec810e234a7b9783eb8f35e2ffd7c60d75e09c7.tar.gz dino-bec810e234a7b9783eb8f35e2ffd7c60d75e09c7.zip |
Visually highlight mentions in MUCs
fixes #267
Diffstat (limited to 'libdino/src/service')
-rw-r--r-- | libdino/src/service/conversation_manager.vala | 6 | ||||
-rw-r--r-- | libdino/src/service/muc_manager.vala | 15 |
2 files changed, 11 insertions, 10 deletions
diff --git a/libdino/src/service/conversation_manager.vala b/libdino/src/service/conversation_manager.vala index f6e3553d..c72500b4 100644 --- a/libdino/src/service/conversation_manager.vala +++ b/libdino/src/service/conversation_manager.vala @@ -26,7 +26,6 @@ public class ConversationManager : StreamInteractionModule, Object { this.stream_interactor = stream_interactor; stream_interactor.add_module(this); stream_interactor.account_added.connect(on_account_added); - stream_interactor.get_module(MucManager.IDENTITY).joined.connect(on_groupchat_joined); stream_interactor.get_module(MessageProcessor.IDENTITY).received_pipeline.connect(new MessageListener(stream_interactor)); stream_interactor.get_module(MessageProcessor.IDENTITY).message_sent.connect(handle_new_message); } @@ -155,11 +154,6 @@ public class ConversationManager : StreamInteractionModule, Object { start_conversation(conversation); } - private void on_groupchat_joined(Account account, Jid jid, string nick) { - Conversation conversation = create_conversation(jid, account, Conversation.Type.GROUPCHAT); - start_conversation(conversation); - } - private void add_conversation(Conversation conversation) { conversations[conversation.account][conversation.counterpart] = conversation; if (conversation.active) { 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) { |