Merge pull request #643 from sachaaaaa/pairing_QR

Show pubkey QR code in primary pairing dialog
pull/654/head
sachaaaaa 6 years ago committed by GitHub
commit 79532d7590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -263,6 +263,9 @@
<!-- Waiting for request --> <!-- Waiting for request -->
<div class="waitingForRequestView" style="display: none;"> <div class="waitingForRequestView" style="display: none;">
<h4>{{ waitingForRequestTitle }}</h4> <h4>{{ waitingForRequestTitle }}</h4>
<div class="qr-dialog">
<div id="qr"></div>
</div>
<div class='buttons'> <div class='buttons'>
<button class="cancel">{{ cancelText }}</button> <button class="cancel">{{ cancelText }}</button>
</div> </div>

@ -5,6 +5,7 @@
textsecure, textsecure,
ConversationController, ConversationController,
$, $,
QRCode,
*/ */
// eslint-disable-next-line func-names // eslint-disable-next-line func-names
@ -21,6 +22,10 @@
this.reset(); this.reset();
this.render(); this.render();
this.showView(); this.showView();
this.qr = new QRCode(this.$('#qr')[0], {
correctLevel: QRCode.CorrectLevel.L,
});
this.qr.makeCode(textsecure.storage.user.getNumber());
}, },
reset() { reset() {
this.pubKey = null; this.pubKey = null;
@ -194,6 +199,7 @@
}, },
close() { close() {
this.remove(); this.remove();
this.qr.clear();
if (this.pubKey && !this.accepted) { if (this.pubKey && !this.accepted) {
this.trigger('devicePairingRequestRejected', this.pubKey); this.trigger('devicePairingRequestRejected', this.pubKey);
} }

Loading…
Cancel
Save