diff options
author | bobufa <bobufa@users.noreply.github.com> | 2018-07-16 21:26:39 +0200 |
---|---|---|
committer | bobufa <bobufa@users.noreply.github.com> | 2018-08-13 22:39:07 +0200 |
commit | 2e2a9a239000509488f1a369ea4eaf4cdda9c0b1 (patch) | |
tree | 8c37f732a3f6b7345a19a8e17e151991ee72d0b6 /libdino/src/service/message_storage.vala | |
parent | 61915ca56617e8f45ae8bd85cb87f0b8a9a895b0 (diff) | |
download | dino-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.vala | 10 |
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; |