From c0314212a0d951494fe6397fa53a9c5689a3ff87 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 24 Mar 2017 00:15:00 +0100 Subject: Tab completion for MUC occupants --- libdino/src/service/message_manager.vala | 6 +++--- libdino/src/service/muc_manager.vala | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'libdino') diff --git a/libdino/src/service/message_manager.vala b/libdino/src/service/message_manager.vala index c2d1021e..1f0d528b 100644 --- a/libdino/src/service/message_manager.vala +++ b/libdino/src/service/message_manager.vala @@ -41,13 +41,13 @@ public class MessageManager : StreamInteractionModule, Object { message_sent(message, conversation); } - public Gee.List? get_messages(Conversation conversation) { + public Gee.List? get_messages(Conversation conversation, int count = 50) { if (messages.has_key(conversation) && messages[conversation].size > 0) { - Gee.List db_messages = db.get_messages(conversation.counterpart, conversation.account, 50, messages[conversation][0]); + Gee.List db_messages = db.get_messages(conversation.counterpart, conversation.account, count, messages[conversation][0]); db_messages.add_all(messages[conversation]); return db_messages; } else { - Gee.List db_messages = db.get_messages(conversation.counterpart, conversation.account, 50, null); + Gee.List db_messages = db.get_messages(conversation.counterpart, conversation.account, count, null); return db_messages; } } diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index f8520064..82d200b0 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -53,7 +53,10 @@ public class MucManager : StreamInteractionModule, Object { } public ArrayList? get_occupants(Jid jid, Account account) { - return stream_interactor.get_module(PresenceManager.IDENTITY).get_full_jids(jid, account); + if (is_groupchat(jid, account)) { + return stream_interactor.get_module(PresenceManager.IDENTITY).get_full_jids(jid, account); + } + return null; } public ArrayList? get_other_occupants(Jid jid, Account account) { -- cgit v1.2.3-70-g09d2