refactor: use parameters in EncryptedFile constructor
This commit is contained in:
parent
2a2a170609
commit
f69acda419
|
|
@ -554,11 +554,12 @@ class Event extends MatrixEvent {
|
||||||
if (!fileMap['key']['key_ops'].contains('decrypt')) {
|
if (!fileMap['key']['key_ops'].contains('decrypt')) {
|
||||||
throw ("Missing 'decrypt' in 'key_ops'.");
|
throw ("Missing 'decrypt' in 'key_ops'.");
|
||||||
}
|
}
|
||||||
final encryptedFile = EncryptedFile();
|
final encryptedFile = EncryptedFile(
|
||||||
encryptedFile.data = uint8list;
|
data: uint8list,
|
||||||
encryptedFile.iv = fileMap['iv'];
|
iv: fileMap['iv'],
|
||||||
encryptedFile.k = fileMap['key']['k'];
|
k: fileMap['key']['k'],
|
||||||
encryptedFile.sha256 = fileMap['hashes']['sha256'];
|
sha256: fileMap['hashes']['sha256'],
|
||||||
|
);
|
||||||
uint8list = await runInBackground(decryptFile, encryptedFile);
|
uint8list = await runInBackground(decryptFile, encryptedFile);
|
||||||
}
|
}
|
||||||
return MatrixFile(bytes: uint8list, name: body);
|
return MatrixFile(bytes: uint8list, name: body);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue