From 3d22abc9cf61d87024828e73140dd31ad55c2524 Mon Sep 17 00:00:00 2001 From: sachaaaaa Date: Fri, 22 Nov 2019 11:20:36 +1100 Subject: [PATCH] Ensure message is not FR --- libtextsecure/message_receiver.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 2e14a0e45..f98acbb53 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -1299,7 +1299,7 @@ MessageReceiver.prototype.extend({ // eslint-disable-next-line no-bitwise const isUnpairingRequest = Boolean(message.flags & UNPAIRING_REQUEST); - if (isUnpairingRequest) { + if (!friendRequest && isUnpairingRequest) { // TODO: move high-level pairing logic to libloki.multidevice.xx const unpairingRequestIsLegit = async () => { @@ -1328,11 +1328,7 @@ MessageReceiver.prototype.extend({ ); // our pubkey should NOT be in the primary device mapping - if (found) { - return false; - } - - return true; + return !found; }; const legit = await unpairingRequestIsLegit();