From 0e41fb3294271fc271ac8d24c1871fbea27e2ba4 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 27 Aug 2018 14:57:02 +0200 Subject: Add `hidden` column to content_item table --- plugins/http-files/src/file_provider.vala | 10 ++++++++-- plugins/http-files/src/manager.vala | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'plugins/http-files/src') diff --git a/plugins/http-files/src/file_provider.vala b/plugins/http-files/src/file_provider.vala index 7616d535..6f4b19f4 100644 --- a/plugins/http-files/src/file_provider.vala +++ b/plugins/http-files/src/file_provider.vala @@ -26,8 +26,8 @@ public class FileProvider : Dino.FileProvider, Object { private class ReceivedMessageListener : MessageListener { - public string[] after_actions_const = new string[]{ }; - public override string action_group { get { return "DECRYPT"; } } + public string[] after_actions_const = new string[]{ "STORE" }; + public override string action_group { get { return ""; } } public override string[] after_actions { get { return after_actions_const; } } private FileProvider outer; @@ -91,6 +91,12 @@ public class FileProvider : Dino.FileProvider, Object { file_transfer.provider = 0; file_transfer.info = message.id.to_string(); file_incoming(file_transfer, conversation); + + ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item(conversation, 1, message.id); + if (content_item != null) { + stream_interactor.get_module(ContentItemStore.IDENTITY).set_item_hide(content_item, true); + } + success = true; Idle.add((owned)callback); }); diff --git a/plugins/http-files/src/manager.vala b/plugins/http-files/src/manager.vala index 9faa8933..78697f9c 100644 --- a/plugins/http-files/src/manager.vala +++ b/plugins/http-files/src/manager.vala @@ -40,6 +40,11 @@ public class Manager : StreamInteractionModule, FileSender, Object { message.encryption = Encryption.NONE; stream_interactor.get_module(MessageProcessor.IDENTITY).send_message(message, conversation); file_transfer.info = message.id.to_string(); + + ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item(conversation, 1, message.id); + if (content_item != null) { + stream_interactor.get_module(ContentItemStore.IDENTITY).set_item_hide(content_item, true); + } }, (stream, error_str) => { print(@"Failed getting upload url + $error_str\n"); -- cgit v1.2.3-70-g09d2