From 16d0cc6fd9bcf7c0c849523d82e1e266bffa3d25 Mon Sep 17 00:00:00 2001 From: LAGonauta Date: Tue, 19 May 2020 07:29:43 -0300 Subject: [PATCH] Set alternate file stream for downloaded files. --- libdino/src/service/file_manager.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libdino/src/service/file_manager.vala b/libdino/src/service/file_manager.vala index 6a851241..cac27828 100644 --- a/libdino/src/service/file_manager.vala +++ b/libdino/src/service/file_manager.vala @@ -248,6 +248,13 @@ public class FileManager : StreamInteractionModule, Object { file_transfer.mime_type = Util.get_content_type(file_info); file_transfer.state = FileTransfer.State.COMPLETE; + +#if _WIN32 // Add Zone.Identifier so Windows knows this file was downloaded from the internet + var file_alternate_stream = File.new_for_path(Path.build_filename(get_storage_dir(), filename + ":Zone.Identifier")); + var os_alternate_stream = file_alternate_stream.create(FileCreateFlags.REPLACE_DESTINATION); + os_alternate_stream.write("[ZoneTransfer]\r\nZoneId=3".data); +#endif + } catch (Error e) { warning("Error downloading file: %s", e.message); file_transfer.state = FileTransfer.State.FAILED;