diff options
author | fiaxh <git@mx.ax.lt> | 2018-01-28 20:56:27 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2018-01-28 22:00:22 +0100 |
commit | f6db249c92e8fd25c1cb52872d3a647be034b626 (patch) | |
tree | 65ebb9d61fd27dcfd37a26137f507413193902d3 /plugins/openpgp/src/in_file_processor.vala | |
parent | bec810e234a7b9783eb8f35e2ffd7c60d75e09c7 (diff) | |
download | dino-f6db249c92e8fd25c1cb52872d3a647be034b626.tar.gz dino-f6db249c92e8fd25c1cb52872d3a647be034b626.zip |
Only display transferred images, display file names, open in system viewer, include and use pgp embedded file names
Diffstat (limited to 'plugins/openpgp/src/in_file_processor.vala')
-rw-r--r-- | plugins/openpgp/src/in_file_processor.vala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/openpgp/src/in_file_processor.vala b/plugins/openpgp/src/in_file_processor.vala index 61baa37e..568315f9 100644 --- a/plugins/openpgp/src/in_file_processor.vala +++ b/plugins/openpgp/src/in_file_processor.vala @@ -17,10 +17,12 @@ public class InFileProcessor : IncommingFileProcessor, Object { data.append_vals(buf, (uint) len); } while(len > 0); - uint8[] clear_data = GPGHelper.decrypt_data(data.data); - file_transfer.input_stream = new MemoryInputStream.from_data(clear_data, GLib.free); + GPGHelper.DecryptedData clear_data = GPGHelper.decrypt_data(data.data); + file_transfer.input_stream = new MemoryInputStream.from_data(clear_data.data, GLib.free); file_transfer.encryption = Encryption.PGP; - if (file_transfer.file_name.has_suffix(".pgp")) { + if (clear_data.filename != null && clear_data.filename != "") { + file_transfer.file_name = clear_data.filename; + } else if (file_transfer.file_name.has_suffix(".pgp")) { file_transfer.file_name = file_transfer.file_name.substring(0, file_transfer.file_name.length - 4); } } catch (Error e) { |