From 1bfad568216447304e8b09211eeec66148b8e660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Wed, 5 Apr 2017 17:24:19 +0200 Subject: [PATCH] [httpupload] Fail on missing python-cryptography Show an error message when OMEMO is activated, but python-cryptography is missing --- httpupload/httpupload.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/httpupload/httpupload.py b/httpupload/httpupload.py index 1450b19..6532985 100644 --- a/httpupload/httpupload.py +++ b/httpupload/httpupload.py @@ -163,8 +163,6 @@ class Base(object): self.set_button_state(state, self.controls[jid]) def encryption_activated(self, jid): - if not ENCRYPTION_AVAILABLE: - return False for plugin in gajim.plugin_manager.active_plugins: if type(plugin).__name__ == 'OmemoPlugin': state = plugin.get_omemo_state(self.account) @@ -196,6 +194,12 @@ class Base(object): return encrypted = self.encryption_activated(jid) + if encrypted and not ENCRYPTION_AVAILABLE: + ErrorDialog( + _('Error'), + 'Please install python-cryptography for encrypted uploads', + transient_for=chat_control.parent_win.window) + return size = os.path.getsize(path) key, iv = None, None if encrypted: