aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/service/message_manager.vala6
-rw-r--r--libdino/src/service/muc_manager.vala5
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) {