Commit 5981396a authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Pass account to plugins when encrypting a file

parent 510985d7
......@@ -167,7 +167,7 @@ def check_file_before_transfer(self, path, encryption, contact, session,
return
if encryption is not None:
app.interface.encrypt_file(file, self._request_slot)
app.interface.encrypt_file(file, self._account, self._request_slot)
else:
self._request_slot(file)
......
......@@ -1141,13 +1141,13 @@ def on_file_dialog_ok(chat_control, paths):
chat_control.session,
groupchat)
def encrypt_file(self, file, callback):
def encrypt_file(self, file, account, callback):
app.nec.push_incoming_event(HTTPUploadProgressEvent(
None, status='encrypt', file=file))
encryption = file.encryption
plugin = app.plugin_manager.encryption_plugins[encryption]
if hasattr(plugin, 'encrypt_file'):
plugin.encrypt_file(file, None, callback)
plugin.encrypt_file(file, account, callback)
else:
app.nec.push_incoming_event(HTTPUploadProgressEvent(
None, status='close', file=file))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment