[omemo] Adapt to Gajim HTTPUpload changes
This commit is contained in:
@@ -221,13 +221,12 @@ class OmemoPlugin(GajimPlugin):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _encrypt_file_thread(file, callback, *args, **kwargs):
|
def _encrypt_file_thread(file, callback, *args, **kwargs):
|
||||||
result = aes_encrypt_file(file.get_data(full=True))
|
result = aes_encrypt_file(file.get_data())
|
||||||
file.encrypted = True
|
|
||||||
file.size = len(result.payload)
|
file.size = len(result.payload)
|
||||||
file.user_data = binascii.hexlify(result.iv + result.key).decode()
|
fragment = binascii.hexlify(result.iv + result.key).decode()
|
||||||
file.data = result.payload
|
file.set_uri_transform_func(
|
||||||
if file.event.isSet():
|
lambda uri: 'aesgcm%s#%s' % (uri[5:], fragment))
|
||||||
return
|
file.set_encrypted_data(result.payload)
|
||||||
GLib.idle_add(callback, file)
|
GLib.idle_add(callback, file)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user