From 661b207245b9b171ba5a456d577578a409cb54e7 Mon Sep 17 00:00:00 2001 From: sachaaaaa Date: Tue, 27 Aug 2019 17:29:37 +1000 Subject: [PATCH] Various fixes for bugs introduced during reviews --- js/views/standalone_registration_view.js | 2 ++ libtextsecure/message_receiver.js | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/views/standalone_registration_view.js b/js/views/standalone_registration_view.js index c3262cecb..ef64c4be7 100644 --- a/js/views/standalone_registration_view.js +++ b/js/views/standalone_registration_view.js @@ -54,6 +54,8 @@ this.showRegisterPage(); this.onValidatePassword(); + + this.onSecondaryDeviceRegistered = this.onSecondaryDeviceRegistered.bind(this); }, events: { 'validation input.number': 'onValidation', diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 9dce8934a..aa271fa89 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -1057,7 +1057,7 @@ MessageReceiver.prototype.extend({ 'Received a pairing request addressed to another pubkey. Ignored.' ); return false; - } else if (authorisation.secondaryDevicePubKey === ourPubKey) { + } else if (isRequest && authorisation.secondaryDevicePubKey === ourPubKey) { window.log.warn('Received a pairing request from ourselves. Ignored.'); return false; } @@ -1066,7 +1066,7 @@ MessageReceiver.prototype.extend({ primaryDevicePubKey, secondaryDevicePubKey, dcodeIO.ByteBuffer.wrap(requestSignature).toArrayBuffer(), - type + textsecure.protobuf.PairingAuthorisationMessage.Type.REQUEST ); } catch (e) { window.log.warn( @@ -1081,7 +1081,7 @@ MessageReceiver.prototype.extend({ primaryDevicePubKey, secondaryDevicePubKey, dcodeIO.ByteBuffer.wrap(grantSignature).toArrayBuffer(), - type + textsecure.protobuf.PairingAuthorisationMessage.Type.GRANT ); } catch (e) { window.log.warn(