[omemo] Add file decryption

This commit is contained in:
Philipp Hörist
2017-03-26 21:09:24 +02:00
parent 65e2f437a5
commit 750528068f
3 changed files with 385 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ from plugins import GajimPlugin
from plugins.helpers import log_calls
from nbxmpp.simplexml import Node
from nbxmpp import NS_CORRECT, NS_ADDRESS
from .file_decryption import FileDecryption
from .xmpp import (
NS_NOTIFY, NS_OMEMO, NS_EME, BundleInformationAnnouncement,
@@ -115,7 +116,9 @@ class OmemoPlugin(GajimPlugin):
self.gui_extension_points = {'chat_control': (self.connect_ui,
self.disconnect_ui),
'groupchat_control': (self.connect_ui,
self.disconnect_ui)}
self.disconnect_ui),
'hyperlink_handler': (self.file_decryption,
None)}
SUPPORTED_PERSONAL_USER_EVENTS.append(DevicelistPEP)
self.plugin = self
self.announced = []
@@ -179,6 +182,9 @@ class OmemoPlugin(GajimPlugin):
'enable_esessions', False)
log.info(str(account) + " => Gajim E2E encryption disabled")
def file_decryption(self, url, kind, instance, window):
FileDecryption(self).hyperlink_handler(url, kind, instance, window)
@log_calls('OmemoPlugin')
def signed_in(self, event):
""" Method called on SignIn