From c7dc79e7f9705c2d2a1a766fe701707cf9119c9a Mon Sep 17 00:00:00 2001 From: sachaaaaa Date: Mon, 26 Aug 2019 15:00:41 +1000 Subject: [PATCH] Fix missing awaits! --- libtextsecure/message_receiver.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 632f73a15..100958825 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -1094,17 +1094,19 @@ MessageReceiver.prototype.extend({ return true; }, async handlePairingRequest(pairingRequest) { - if (!this.validateAuthorisation(pairingRequest)) { + const valid = await this.validateAuthorisation(pairingRequest); + if (!valid) { return; } - window.libloki.storage.savePairingAuthorisation(pairingRequest); + await window.libloki.storage.savePairingAuthorisation(pairingRequest); Whisper.events.trigger( 'devicePairingRequestReceived', pairingRequest.secondaryDevicePubKey ); }, async handleAuthorisationForSelf(pairingAuthorisation) { - if (!this.validateAuthorisation(pairingAuthorisation)) { + const valid = await this.validateAuthorisation(pairingAuthorisation); + if (!valid) { return; } const { type, primaryDevicePubKey } = pairingAuthorisation; @@ -1132,7 +1134,8 @@ MessageReceiver.prototype.extend({ } }, async handleAuthorisationForContact(pairingAuthorisation) { - if (!this.validateAuthorisation(pairingAuthorisation)) { + const valid = this.validateAuthorisation(pairingAuthorisation); + if (!valid) { return; } const { primaryDevicePubKey, secondaryDevicePubKey } = pairingAuthorisation;