From d5ddc1c5365307d28079662ac0972af2fa60d362 Mon Sep 17 00:00:00 2001 From: sachaaaaa Date: Thu, 26 Sep 2019 16:49:01 +1000 Subject: [PATCH] No need to attach authorisation with every friend request --- libtextsecure/outgoing_message.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/libtextsecure/outgoing_message.js b/libtextsecure/outgoing_message.js index 98b73f24f..e098689de 100644 --- a/libtextsecure/outgoing_message.js +++ b/libtextsecure/outgoing_message.js @@ -341,23 +341,6 @@ OutgoingMessage.prototype = { // Check if we need to attach the preKeys let sessionCipher; const isFriendRequest = this.messageType === 'friend-request'; - const isSecondaryDevice = !!window.storage.get('isSecondaryDevice'); - if (isFriendRequest && isSecondaryDevice) { - // Attach authorisation from primary device ONLY FOR FRIEND REQUEST - const ourPubKeyHex = textsecure.storage.user.getNumber(); - const pairingAuthorisation = await libloki.storage.getGrantAuthorisationForSecondaryPubKey( - ourPubKeyHex - ); - if (pairingAuthorisation) { - this.message.pairingAuthorisation = libloki.api.createPairingAuthorisationProtoMessage( - pairingAuthorisation - ); - } else { - window.log.error( - 'Could not find authorisation for our own pubkey while being secondary device.' - ); - } - } this.fallBackEncryption = this.fallBackEncryption || isFriendRequest; const flags = this.message.dataMessage ? this.message.dataMessage.get_flags()