aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/message_storage.vala
diff options
context:
space:
mode:
authorbobufa <bobufa@users.noreply.github.com>2018-07-16 21:26:39 +0200
committerbobufa <bobufa@users.noreply.github.com>2018-08-13 22:39:07 +0200
commit2e2a9a239000509488f1a369ea4eaf4cdda9c0b1 (patch)
tree8c37f732a3f6b7345a19a8e17e151991ee72d0b6 /libdino/src/service/message_storage.vala
parent61915ca56617e8f45ae8bd85cb87f0b8a9a895b0 (diff)
downloaddino-2e2a9a239000509488f1a369ea4eaf4cdda9c0b1.tar.gz
dino-2e2a9a239000509488f1a369ea4eaf4cdda9c0b1.zip
accumulate conversation content in meta db table
Diffstat (limited to 'libdino/src/service/message_storage.vala')
-rw-r--r--libdino/src/service/message_storage.vala10
1 files changed, 9 insertions, 1 deletions
diff --git a/libdino/src/service/message_storage.vala b/libdino/src/service/message_storage.vala
index abc8acb4..9fb6ab19 100644
--- a/libdino/src/service/message_storage.vala
+++ b/libdino/src/service/message_storage.vala
@@ -76,7 +76,15 @@ public class MessageStorage : StreamInteractionModule, Object {
return db_messages;
}
- public Message? get_message_by_id(string stanza_id, Conversation conversation) {
+ public Message? get_message_by_id(int id, Conversation conversation) {
+ init_conversation(conversation);
+ foreach (Message message in messages[conversation]) {
+ if (message.id == id) return message;
+ }
+ return null;
+ }
+
+ public Message? get_message_by_stanza_id(string stanza_id, Conversation conversation) {
init_conversation(conversation);
foreach (Message message in messages[conversation]) {
if (message.stanza_id == stanza_id) return message;