aboutsummaryrefslogtreecommitdiff
path: root/plugins/http-files/src
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2018-11-27 18:28:28 +0100
committerfiaxh <git@lightrise.org>2018-11-27 18:28:28 +0100
commit7c1d580e174ff31a55677e976d87284868bd99c6 (patch)
tree986a66282848c06390ce1e9f0e9494965aa6a1d3 /plugins/http-files/src
parent141db9e40a3a81cfa3ad3587dc47f69c541d0fde (diff)
downloaddino-7c1d580e174ff31a55677e976d87284868bd99c6.tar.gz
dino-7c1d580e174ff31a55677e976d87284868bd99c6.zip
Fix aesgcm http file up/download bugs
Diffstat (limited to 'plugins/http-files/src')
-rw-r--r--plugins/http-files/src/file_provider.vala12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/http-files/src/file_provider.vala b/plugins/http-files/src/file_provider.vala
index 19d34bb0..3fa32097 100644
--- a/plugins/http-files/src/file_provider.vala
+++ b/plugins/http-files/src/file_provider.vala
@@ -63,16 +63,18 @@ public class FileProvider : Dino.FileProvider, Object {
file_transfer.info = message.id.to_string();
if (stream_interactor.get_module(FileManager.IDENTITY).is_sender_trustworthy(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);
- }
yield get_meta_info(file_transfer);
+ if (file_transfer.size >= 0 && file_transfer.size < 5000000) {
+ 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);
+ }
+ }
file_incoming(file_transfer, conversation);
}
}
- private async void get_meta_info(FileTransfer file_transfer) {
+ public async void get_meta_info(FileTransfer file_transfer) {
string url_body = dino_db.message.select({dino_db.message.body}).with(dino_db.message.id, "=", int.parse(file_transfer.info))[dino_db.message.body];
var session = new Soup.Session();
var head_message = new Soup.Message("HEAD", url_body);