diff options
author | fiaxh <git@lightrise.org> | 2019-07-18 02:03:42 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2019-07-18 02:03:42 +0200 |
commit | f0abb8aaf9d06106235ca5e0e6b3ca2e425c4422 (patch) | |
tree | 03fce63f8c37b50b5202690a6801234724ed0021 /plugins/openpgp/src/out_file_processor.vala | |
parent | 30353e92d63c033857ad0396c921b3bf5cab44c3 (diff) | |
download | dino-f0abb8aaf9d06106235ca5e0e6b3ca2e425c4422.tar.gz dino-f0abb8aaf9d06106235ca5e0e6b3ca2e425c4422.zip |
Refactor file receive/send interfaces and UI
Diffstat (limited to 'plugins/openpgp/src/out_file_processor.vala')
-rw-r--r-- | plugins/openpgp/src/out_file_processor.vala | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/plugins/openpgp/src/out_file_processor.vala b/plugins/openpgp/src/out_file_processor.vala deleted file mode 100644 index 40eef7f5..00000000 --- a/plugins/openpgp/src/out_file_processor.vala +++ /dev/null @@ -1,32 +0,0 @@ -using Dino.Entities; - -namespace Dino.Plugins.OpenPgp { - -public class OutFileProcessor : OutgoingFileProcessor, Object { - - StreamInteractor stream_interactor; - - public OutFileProcessor(StreamInteractor stream_interactor) { - this.stream_interactor = stream_interactor; - } - - public bool can_process(Conversation conversation, FileTransfer file_transfer) { - return conversation.encryption == Encryption.PGP; - } - - public void process(Conversation conversation, FileTransfer file_transfer) { - string path = file_transfer.get_file().get_path(); - try { - GPG.Key[] keys = stream_interactor.get_module(Manager.IDENTITY).get_key_fprs(conversation); - uint8[] enc_content = GPGHelper.encrypt_file(path, keys, GPG.EncryptFlags.ALWAYS_TRUST, file_transfer.file_name); - file_transfer.input_stream = new MemoryInputStream.from_data(enc_content, GLib.free); - file_transfer.encryption = Encryption.PGP; - file_transfer.server_file_name = Xmpp.random_uuid() + ".pgp"; - } catch (Error e) { - warning(@"PGP file encryption error: $(e.message)\n"); - file_transfer.state = FileTransfer.State.FAILED; - } - } -} - -} |