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

Merge remote-tracking branch 'origin/develop' into rav/async_crypto/olmlib

This commit is contained in:
Richard van der Hoff
2017-08-09 18:11:48 +01:00
6 changed files with 42 additions and 37 deletions

View File

@@ -176,7 +176,7 @@ OlmDecryption.prototype.decryptEvent = async function(event) {
let payloadString;
try {
payloadString = this._decryptMessage(deviceKey, message);
payloadString = await this._decryptMessage(deviceKey, message);
} catch (e) {
throw new base.DecryptionError(
"Bad Encrypted Message", {
@@ -239,7 +239,9 @@ OlmDecryption.prototype.decryptEvent = async function(event) {
*
* @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);
// try each session in turn.