diff options
author | fiaxh <git@lightrise.org> | 2020-09-02 16:47:41 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-09-07 15:14:29 +0200 |
commit | 49bcbdaa517e5d6f8d4860db70ae0a9960e2c519 (patch) | |
tree | 7275f69dc7ef36022eace7cfbc0bb7f66be60824 /plugins | |
parent | e327a88898a90543f1de851274274139642c9a21 (diff) | |
download | dino-49bcbdaa517e5d6f8d4860db70ae0a9960e2c519.tar.gz dino-49bcbdaa517e5d6f8d4860db70ae0a9960e2c519.zip |
Fix initial file encryption displaying
fixes #831
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/http-files/src/file_provider.vala | 4 | ||||
-rw-r--r-- | plugins/omemo/src/file_transfer/file_decryptor.vala | 4 | ||||
-rw-r--r-- | plugins/omemo/src/jingle/jingle_helper.vala | 8 | ||||
-rw-r--r-- | plugins/openpgp/src/file_transfer/file_decryptor.vala | 4 |
4 files changed, 16 insertions, 4 deletions
diff --git a/plugins/http-files/src/file_provider.vala b/plugins/http-files/src/file_provider.vala index 715f3e62..fd952b6b 100644 --- a/plugins/http-files/src/file_provider.vala +++ b/plugins/http-files/src/file_provider.vala @@ -92,6 +92,10 @@ public class FileProvider : Dino.FileProvider, Object { return file_meta; } + public Encryption get_encryption(FileTransfer file_transfer, FileReceiveData receive_data, FileMeta file_meta) { + return Encryption.NONE; + } + public async InputStream download(FileTransfer file_transfer, FileReceiveData receive_data, FileMeta file_meta) throws FileReceiveError { HttpFileReceiveData? http_receive_data = receive_data as HttpFileReceiveData; if (http_receive_data == null) assert(false); diff --git a/plugins/omemo/src/file_transfer/file_decryptor.vala b/plugins/omemo/src/file_transfer/file_decryptor.vala index 3999d3b8..7aec41d5 100644 --- a/plugins/omemo/src/file_transfer/file_decryptor.vala +++ b/plugins/omemo/src/file_transfer/file_decryptor.vala @@ -13,6 +13,10 @@ public class OmemoFileDecryptor : FileDecryptor, Object { private Regex url_regex = /^aesgcm:\/\/(.*)#(([A-Fa-f0-9]{2}){48}|([A-Fa-f0-9]{2}){44})$/; + public Encryption get_encryption() { + return Encryption.OMEMO; + } + public FileReceiveData prepare_get_meta_info(Conversation conversation, FileTransfer file_transfer, FileReceiveData receive_data) { HttpFileReceiveData? http_receive_data = receive_data as HttpFileReceiveData; if (http_receive_data == null) assert(false); diff --git a/plugins/omemo/src/jingle/jingle_helper.vala b/plugins/omemo/src/jingle/jingle_helper.vala index 4b6ed646..ec6c0eca 100644 --- a/plugins/omemo/src/jingle/jingle_helper.vala +++ b/plugins/omemo/src/jingle/jingle_helper.vala @@ -42,12 +42,12 @@ public class EncryptionHelper : JingleFileEncryptionHelper, Object { return new Xep.Jet.Options(Omemo.NS_URI, AES_128_GCM_URI); } - public FileMeta complete_meta(FileTransfer file_transfer, FileReceiveData receive_data, FileMeta file_meta, Xmpp.Xep.JingleFileTransfer.FileTransfer jingle_transfer) { + public Encryption get_encryption(Xmpp.Xep.JingleFileTransfer.FileTransfer jingle_transfer) { Xep.Jet.SecurityParameters? security = jingle_transfer.security as Xep.Jet.SecurityParameters; if (security != null && security.encoding.get_type_uri() == Omemo.NS_URI) { - file_transfer.encryption = Encryption.OMEMO; + return Encryption.OMEMO; } - return file_meta; + return Encryption.NONE; } } -}
\ No newline at end of file +} diff --git a/plugins/openpgp/src/file_transfer/file_decryptor.vala b/plugins/openpgp/src/file_transfer/file_decryptor.vala index 455f853d..202fa9c9 100644 --- a/plugins/openpgp/src/file_transfer/file_decryptor.vala +++ b/plugins/openpgp/src/file_transfer/file_decryptor.vala @@ -4,6 +4,10 @@ namespace Dino.Plugins.OpenPgp { public class PgpFileDecryptor : FileDecryptor, Object { + public Encryption get_encryption() { + return Encryption.PGP; + } + public FileReceiveData prepare_get_meta_info(Conversation conversation, FileTransfer file_transfer, FileReceiveData receive_data) { return receive_data; } |