From 75e51b5ed3b639b9cf7b16b0ddbee7e362c44ef1 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 4 Apr 2017 15:47:00 +0200 Subject: MessageStorage/Processor, correctly resolve conversations (fixup 22adbd3) --- main/src/ui/chat_input/occupants_tab_completer.vala | 14 ++++++-------- main/src/ui/chat_input/view.vala | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'main/src/ui/chat_input') diff --git a/main/src/ui/chat_input/occupants_tab_completer.vala b/main/src/ui/chat_input/occupants_tab_completer.vala index 93b0e7ff..9ef73d8b 100644 --- a/main/src/ui/chat_input/occupants_tab_completer.vala +++ b/main/src/ui/chat_input/occupants_tab_completer.vala @@ -87,14 +87,12 @@ class OccupantsTabCompletor { private Gee.List generate_completions_from_messages() { Gee.List ret = new ArrayList(); - Gee.List? messages = stream_interactor.get_module(MessageManager.IDENTITY).get_messages(conversation, 10); - if (messages != null) { - for (int i = messages.size - 1; i > 0; i--) { - string resourcepart = messages[i].from.resourcepart; - string own_nick = stream_interactor.get_module(MucManager.IDENTITY).get_nick(conversation.counterpart, conversation.account); - if (resourcepart != null && resourcepart != "" && resourcepart != own_nick && !ret.contains(resourcepart)) { - ret.add(resourcepart); - } + Gee.List messages = stream_interactor.get_module(MessageStorage.IDENTITY).get_messages(conversation, 10); + for (int i = messages.size - 1; i > 0; i--) { + string resourcepart = messages[i].from.resourcepart; + string own_nick = stream_interactor.get_module(MucManager.IDENTITY).get_nick(conversation.counterpart, conversation.account); + if (resourcepart != null && resourcepart != "" && resourcepart != own_nick && !ret.contains(resourcepart)) { + ret.add(resourcepart); } } return ret; diff --git a/main/src/ui/chat_input/view.vala b/main/src/ui/chat_input/view.vala index 310c0f35..c0acfcfa 100644 --- a/main/src/ui/chat_input/view.vala +++ b/main/src/ui/chat_input/view.vala @@ -56,7 +56,7 @@ public class View : Box { stream_interactor.get_module(MucManager.IDENTITY).kick(conversation.account, conversation.counterpart, token[1]); break; case "/me": - stream_interactor.get_module(MessageManager.IDENTITY).send_message(text, conversation); + stream_interactor.get_module(MessageProcessor.IDENTITY).send_message(text, conversation); break; case "/nick": stream_interactor.get_module(MucManager.IDENTITY).change_nick(conversation.account, conversation.counterpart, token[1]); @@ -66,7 +66,7 @@ public class View : Box { break; } } else { - stream_interactor.get_module(MessageManager.IDENTITY).send_message(text, conversation); + stream_interactor.get_module(MessageProcessor.IDENTITY).send_message(text, conversation); } text_input.buffer.text = ""; } -- cgit v1.2.3-70-g09d2