[pgp] Fixed file sharing feature

The encrypt_file method from PGP module needed a stream instead of
bytes
This commit is contained in:
XutaxKamay
2021-04-24 17:00:11 +02:00
committed by lovetox
parent d349e5bf44
commit 96d4f5e2b5

View File

@@ -281,8 +281,11 @@ class PGPLegacy(BaseModule):
self._log.warning(error)
return
encrypted = self._pgp.encrypt_file(file.get_data(),
stream = open(file.path, "rb")
encrypted = self._pgp.encrypt_file(stream,
[key_id, own_key_id])
stream.close()
if not encrypted:
GLib.idle_add(self._on_file_encryption_error, encrypted.status)
return