1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Make OlmDevice olmSession methods asynchronous

* OlmDevice.encryptMessage
* OlmDevice.decryptMessage
* OlmDevice.matchesSession
This commit is contained in:
Richard van der Hoff
2017-08-10 15:01:56 +01:00
parent 8f527a6212
commit e943a6e09c
3 changed files with 9 additions and 9 deletions

View File

@@ -251,7 +251,7 @@ OlmDecryption.prototype._decryptMessage = async function(
for (let i = 0; i < sessionIds.length; i++) {
const sessionId = sessionIds[i];
try {
const payload = this._olmDevice.decryptMessage(
const payload = await this._olmDevice.decryptMessage(
theirDeviceIdentityKey, sessionId, message.type, message.body,
);
console.log(
@@ -260,7 +260,7 @@ OlmDecryption.prototype._decryptMessage = async function(
);
return payload;
} catch (e) {
const foundSession = this._olmDevice.matchesSession(
const foundSession = await this._olmDevice.matchesSession(
theirDeviceIdentityKey, sessionId, message.type, message.body,
);