diff options
author | fiaxh <git@mx.ax.lt> | 2017-10-22 02:43:04 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-10-22 18:26:31 +0200 |
commit | 555187deb9a5ce1af94d241868de6babdd6166b6 (patch) | |
tree | 0c2e238b06ec458e9c05f578ea6d495cf61c23ed /libdino/src/service/database.vala | |
parent | e49fc134ddf4c1b4e22603b60ea44f59eec496a5 (diff) | |
download | dino-555187deb9a5ce1af94d241868de6babdd6166b6.tar.gz dino-555187deb9a5ce1af94d241868de6babdd6166b6.zip |
Offline messages for MUCs
fixes #187
Diffstat (limited to 'libdino/src/service/database.vala')
-rw-r--r-- | libdino/src/service/database.vala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index 1678c077..532d9f0d 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -253,11 +253,14 @@ public class Database : Qlite.Database { return ret; } - public Gee.List<Message> get_unsend_messages(Account account) { + public Gee.List<Message> get_unsend_messages(Account account, Jid? jid = null) { Gee.List<Message> ret = new ArrayList<Message>(); var select = message.select() .with(message.account_id, "=", account.id) .with(message.marked, "=", (int) Message.Marked.UNSENT); + if (jid != null) { + select.with(message.counterpart_id, "=", get_jid_id(jid)); + } foreach (Row row in select) { ret.add(new Message.from_row(this, row)); } |