From e8834930f906e37d962aa534b6a78428fed2fd0f Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 14 Aug 2019 13:58:27 +0100
Subject: [PATCH 1/2] Verifying your own device should not ask you to "contact
its owner"
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
.../views/dialogs/DeviceVerifyDialog.js | 16 ++++++++++++----
src/i18n/strings/en_EN.json | 3 ++-
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/components/views/dialogs/DeviceVerifyDialog.js b/src/components/views/dialogs/DeviceVerifyDialog.js
index c901942fcd..88934baf5f 100644
--- a/src/components/views/dialogs/DeviceVerifyDialog.js
+++ b/src/components/views/dialogs/DeviceVerifyDialog.js
@@ -2,6 +2,7 @@
Copyright 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright 2019 New Vector Ltd
+Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -241,6 +242,16 @@ export default class DeviceVerifyDialog extends React.Component {
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
const AccessibleButton = sdk.getComponent('views.elements.AccessibleButton');
+ let text;
+ if (MatrixClientPeg.get().getUserId() === this.props.userId) {
+ text = _t("To verify that this device can be trusted, please check that the key you see " +
+ "in User Settings on that device matches the key below:")
+ } else {
+ text = _t("To verify that this device can be trusted, please contact its owner using some other " +
+ "means (e.g. in person or a phone call) and ask them whether the key they see in their User Settings " +
+ "for this device matches the key below:");
+ }
+
const key = FormattingUtils.formatCryptoKey(this.props.device.getFingerprint());
const body = (
@@ -250,10 +261,7 @@ export default class DeviceVerifyDialog extends React.Component {
{_t("Use two-way text verification")}
- { _t("To verify that this device can be trusted, please contact its " +
- "owner using some other means (e.g. in person or a phone call) " +
- "and ask them whether the key they see in their User Settings " +
- "for this device matches the key below:") }
+ { text }
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 714e597c7a..09ed300abc 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -1176,8 +1176,9 @@
"Waiting for partner to accept...": "Waiting for partner to accept...",
"Nothing appearing? Not all clients support interactive verification yet. .": "Nothing appearing? Not all clients support interactive verification yet. .",
"Waiting for %(userId)s to confirm...": "Waiting for %(userId)s to confirm...",
- "Use two-way text verification": "Use two-way text verification",
+ "To verify that this device can be trusted, please check that the key you see in User Settings on that device matches the key below:": "To verify that this device can be trusted, please check that the key you see in User Settings on that device matches the key below:",
"To verify that this device can be trusted, please contact its owner using some other means (e.g. in person or a phone call) and ask them whether the key they see in their User Settings for this device matches the key below:": "To verify that this device can be trusted, please contact its owner using some other means (e.g. in person or a phone call) and ask them whether the key they see in their User Settings for this device matches the key below:",
+ "Use two-way text verification": "Use two-way text verification",
"Device name": "Device name",
"Device key": "Device key",
"If it matches, press the verify button below. If it doesn't, then someone else is intercepting this device and you probably want to press the blacklist button instead.": "If it matches, press the verify button below. If it doesn't, then someone else is intercepting this device and you probably want to press the blacklist button instead.",
From 8186f1be2e03ebaa94d2d5bc1ae819cceb8f0e6c Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 14 Aug 2019 14:08:10 +0100
Subject: [PATCH 2/2] delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/dialogs/DeviceVerifyDialog.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/views/dialogs/DeviceVerifyDialog.js b/src/components/views/dialogs/DeviceVerifyDialog.js
index 88934baf5f..710a92aa39 100644
--- a/src/components/views/dialogs/DeviceVerifyDialog.js
+++ b/src/components/views/dialogs/DeviceVerifyDialog.js
@@ -245,7 +245,7 @@ export default class DeviceVerifyDialog extends React.Component {
let text;
if (MatrixClientPeg.get().getUserId() === this.props.userId) {
text = _t("To verify that this device can be trusted, please check that the key you see " +
- "in User Settings on that device matches the key below:")
+ "in User Settings on that device matches the key below:");
} else {
text = _t("To verify that this device can be trusted, please contact its owner using some other " +
"means (e.g. in person or a phone call) and ask them whether the key they see in their User Settings " +