diff options
author | Marvin W <git@larma.de> | 2018-11-09 10:42:23 -0600 |
---|---|---|
committer | Marvin W <git@larma.de> | 2018-11-10 08:05:54 -0600 |
commit | 214906e1a527e618852fcef20e3d941ec3285301 (patch) | |
tree | 0651b415dd2a029e14011da401b98baccecc8e3c /libdino | |
parent | dfb75e2cda1eb9edbbdd9ea88c131d9cb31742ed (diff) | |
download | dino-214906e1a527e618852fcef20e3d941ec3285301.tar.gz dino-214906e1a527e618852fcef20e3d941ec3285301.zip |
Hide OMEMO messages from untrusted sources
Diffstat (limited to 'libdino')
-rw-r--r-- | libdino/src/service/content_item_store.vala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libdino/src/service/content_item_store.vala b/libdino/src/service/content_item_store.vala index 9eba26ba..9f39ce59 100644 --- a/libdino/src/service/content_item_store.vala +++ b/libdino/src/service/content_item_store.vala @@ -144,6 +144,7 @@ public class ContentItemStore : StreamInteractionModule, Object { QueryBuilder select = db.content_item.select(); select.with(db.content_item.foreign_id, "=", message.id); select.with(db.content_item.content_type, "=", 1); + select.with(db.content_item.hide, "=", false); foreach (Row row in select) { MessageItem item = new MessageItem(message, conversation, row[db.content_item.id]); if (!discard(item)) { @@ -167,6 +168,10 @@ public class ContentItemStore : StreamInteractionModule, Object { } } + public bool get_item_hide(ContentItem content_item) { + return db.content_item.row_with(db.content_item.id, content_item.id)[db.content_item.hide, false]; + } + public void set_item_hide(ContentItem content_item, bool hide) { db.content_item.update() .with(db.content_item.id, "=", content_item.id) |