diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-24 00:15:00 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-24 00:24:33 +0100 |
commit | c0314212a0d951494fe6397fa53a9c5689a3ff87 (patch) | |
tree | b97793573e7729208bbaa1b7376842de7e6b8cec /libdino/src | |
parent | 5862e253377a5d6259dfa6a8cc0731f2f7028830 (diff) | |
download | dino-c0314212a0d951494fe6397fa53a9c5689a3ff87.tar.gz dino-c0314212a0d951494fe6397fa53a9c5689a3ff87.zip |
Tab completion for MUC occupants
Diffstat (limited to 'libdino/src')
-rw-r--r-- | libdino/src/service/message_manager.vala | 6 | ||||
-rw-r--r-- | libdino/src/service/muc_manager.vala | 5 |
2 files changed, 7 insertions, 4 deletions
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<Entities.Message>? get_messages(Conversation conversation) { + public Gee.List<Entities.Message>? get_messages(Conversation conversation, int count = 50) { if (messages.has_key(conversation) && messages[conversation].size > 0) { - Gee.List<Entities.Message> db_messages = db.get_messages(conversation.counterpart, conversation.account, 50, messages[conversation][0]); + Gee.List<Entities.Message> 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<Entities.Message> db_messages = db.get_messages(conversation.counterpart, conversation.account, 50, null); + Gee.List<Entities.Message> 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<Jid>? 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<Jid>? get_other_occupants(Jid jid, Account account) { |