aboutsummaryrefslogtreecommitdiff
path: root/plugins/openpgp/src/out_file_processor.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-10-29 15:15:28 +0100
committerfiaxh <git@mx.ax.lt>2017-10-31 15:41:45 +0100
commit0102abeec1d2055b19dccbb7edc7f06e527642b1 (patch)
tree4018e82224c19142c4a7a6eced67d9c2550b2dd8 /plugins/openpgp/src/out_file_processor.vala
parentb9df78e4494879752e9e68dcc5d54e03fffe9467 (diff)
downloaddino-0102abeec1d2055b19dccbb7edc7f06e527642b1.tar.gz
dino-0102abeec1d2055b19dccbb7edc7f06e527642b1.zip
Fix warnings
Diffstat (limited to 'plugins/openpgp/src/out_file_processor.vala')
-rw-r--r--plugins/openpgp/src/out_file_processor.vala14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/openpgp/src/out_file_processor.vala b/plugins/openpgp/src/out_file_processor.vala
index 81c53b16..a09e17a6 100644
--- a/plugins/openpgp/src/out_file_processor.vala
+++ b/plugins/openpgp/src/out_file_processor.vala
@@ -16,11 +16,15 @@ public class OutFileProcessor : OutgoingFileProcessor, Object {
public void process(Conversation conversation, FileTransfer file_transfer) {
string uri = file_transfer.get_uri();
- GPG.Key[] keys = stream_interactor.get_module(Manager.IDENTITY).get_key_fprs(conversation);
- uint8[] enc_content = GPGHelper.encrypt_file(uri, keys, GPG.EncryptFlags.ALWAYS_TRUST);
- file_transfer.input_stream = new MemoryInputStream.from_data(enc_content, GLib.free);
- file_transfer.encryption = Encryption.PGP;
- file_transfer.server_file_name = file_transfer.server_file_name + ".pgp";
+ try {
+ GPG.Key[] keys = stream_interactor.get_module(Manager.IDENTITY).get_key_fprs(conversation);
+ uint8[] enc_content = GPGHelper.encrypt_file(uri, keys, GPG.EncryptFlags.ALWAYS_TRUST);
+ file_transfer.input_stream = new MemoryInputStream.from_data(enc_content, GLib.free);
+ file_transfer.encryption = Encryption.PGP;
+ file_transfer.server_file_name = file_transfer.server_file_name + ".pgp";
+ } catch (Error e) {
+ file_transfer.state = FileTransfer.State.FAILED;
+ }
}
}