You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
make olm._decryptMessage asynchronous
This commit is contained in:
@@ -172,7 +172,7 @@ OlmDecryption.prototype.decryptEvent = async function(event) {
|
|||||||
let payloadString;
|
let payloadString;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
payloadString = this._decryptMessage(deviceKey, message);
|
payloadString = await this._decryptMessage(deviceKey, message);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new base.DecryptionError(
|
throw new base.DecryptionError(
|
||||||
"Bad Encrypted Message", {
|
"Bad Encrypted Message", {
|
||||||
@@ -235,7 +235,9 @@ OlmDecryption.prototype.decryptEvent = async function(event) {
|
|||||||
*
|
*
|
||||||
* @return {string} payload, if decrypted successfully.
|
* @return {string} payload, if decrypted successfully.
|
||||||
*/
|
*/
|
||||||
OlmDecryption.prototype._decryptMessage = function(theirDeviceIdentityKey, message) {
|
OlmDecryption.prototype._decryptMessage = async function(
|
||||||
|
theirDeviceIdentityKey, message,
|
||||||
|
) {
|
||||||
const sessionIds = this._olmDevice.getSessionIdsForDevice(theirDeviceIdentityKey);
|
const sessionIds = this._olmDevice.getSessionIdsForDevice(theirDeviceIdentityKey);
|
||||||
|
|
||||||
// try each session in turn.
|
// try each session in turn.
|
||||||
|
|||||||
Reference in New Issue
Block a user