From 214906e1a527e618852fcef20e3d941ec3285301 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 9 Nov 2018 10:42:23 -0600 Subject: Hide OMEMO messages from untrusted sources --- libdino/src/service/content_item_store.vala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libdino') 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) -- cgit v1.2.3-70-g09d2