Pass account to plugins when encrypting a file

This commit is contained in:
Philipp Hörist 2018-11-11 10:40:48 +01:00
parent 510985d7c4
commit 5981396ac4
2 changed files with 3 additions and 3 deletions

View File

@ -167,7 +167,7 @@ class HTTPUpload:
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)

View File

@ -1141,13 +1141,13 @@ class Interface:
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))