[omemo] Adapt to link handler changes in Gajim
This commit is contained in:
@@ -33,6 +33,7 @@ from gi.repository import GLib
|
|||||||
|
|
||||||
from gajim.common import app
|
from gajim.common import app
|
||||||
from gajim.common import configpaths
|
from gajim.common import configpaths
|
||||||
|
from gajim.common.const import URIType
|
||||||
from gajim.plugins.plugins_i18n import _
|
from gajim.plugins.plugins_i18n import _
|
||||||
from gajim.gtk.dialogs import ErrorDialog, YesNoDialog
|
from gajim.gtk.dialogs import ErrorDialog, YesNoDialog
|
||||||
|
|
||||||
@@ -70,11 +71,11 @@ class FileDecryption:
|
|||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.window = None
|
self.window = None
|
||||||
|
|
||||||
def hyperlink_handler(self, url, kind, instance, window):
|
def hyperlink_handler(self, uri, instance, window):
|
||||||
if ERROR or kind != 'url':
|
if ERROR or uri.type != URIType.WEB:
|
||||||
return
|
return
|
||||||
self.window = window
|
self.window = window
|
||||||
urlparts = urlparse(url)
|
urlparts = urlparse(uri.data)
|
||||||
file = File(urlparts.geturl(), instance.account)
|
file = File(urlparts.geturl(), instance.account)
|
||||||
|
|
||||||
if urlparts.scheme not in ['https', 'aesgcm'] or not urlparts.netloc:
|
if urlparts.scheme not in ['https', 'aesgcm'] or not urlparts.netloc:
|
||||||
|
|||||||
@@ -211,9 +211,9 @@ class OmemoPlugin(GajimPlugin):
|
|||||||
return
|
return
|
||||||
self.get_omemo(account).encrypt_message(conn, obj, callback, False)
|
self.get_omemo(account).encrypt_message(conn, obj, callback, False)
|
||||||
|
|
||||||
def _file_decryption(self, url, kind, instance, window):
|
def _file_decryption(self, uri, instance, window):
|
||||||
file_crypto.FileDecryption(self).hyperlink_handler(
|
file_crypto.FileDecryption(self).hyperlink_handler(
|
||||||
url, kind, instance, window)
|
uri, instance, window)
|
||||||
|
|
||||||
def encrypt_file(self, file, _account, callback):
|
def encrypt_file(self, file, _account, callback):
|
||||||
thread = threading.Thread(target=self._encrypt_file_thread,
|
thread = threading.Thread(target=self._encrypt_file_thread,
|
||||||
|
|||||||
Reference in New Issue
Block a user