Merge pull request #444 from sachaaaaa/logic_fixes

[multi-device] Fix bugs revealed during reviews
pull/454/head
sachaaaaa 6 years ago committed by GitHub
commit 1d4c98adf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -54,6 +54,8 @@
this.showRegisterPage(); this.showRegisterPage();
this.onValidatePassword(); this.onValidatePassword();
this.onSecondaryDeviceRegistered = this.onSecondaryDeviceRegistered.bind(this);
}, },
events: { events: {
'validation input.number': 'onValidation', 'validation input.number': 'onValidation',

@ -1057,7 +1057,7 @@ MessageReceiver.prototype.extend({
'Received a pairing request addressed to another pubkey. Ignored.' 'Received a pairing request addressed to another pubkey. Ignored.'
); );
return false; return false;
} else if (authorisation.secondaryDevicePubKey === ourPubKey) { } else if (isRequest && authorisation.secondaryDevicePubKey === ourPubKey) {
window.log.warn('Received a pairing request from ourselves. Ignored.'); window.log.warn('Received a pairing request from ourselves. Ignored.');
return false; return false;
} }
@ -1066,7 +1066,7 @@ MessageReceiver.prototype.extend({
primaryDevicePubKey, primaryDevicePubKey,
secondaryDevicePubKey, secondaryDevicePubKey,
dcodeIO.ByteBuffer.wrap(requestSignature).toArrayBuffer(), dcodeIO.ByteBuffer.wrap(requestSignature).toArrayBuffer(),
type textsecure.protobuf.PairingAuthorisationMessage.Type.REQUEST
); );
} catch (e) { } catch (e) {
window.log.warn( window.log.warn(
@ -1081,7 +1081,7 @@ MessageReceiver.prototype.extend({
primaryDevicePubKey, primaryDevicePubKey,
secondaryDevicePubKey, secondaryDevicePubKey,
dcodeIO.ByteBuffer.wrap(grantSignature).toArrayBuffer(), dcodeIO.ByteBuffer.wrap(grantSignature).toArrayBuffer(),
type textsecure.protobuf.PairingAuthorisationMessage.Type.GRANT
); );
} catch (e) { } catch (e) {
window.log.warn( window.log.warn(

Loading…
Cancel
Save