From 9f5f15d1d3a597e6cc12f2e0d95b83255dd94c99 Mon Sep 17 00:00:00 2001 From: Zoe Date: Thu, 30 Jan 2020 15:58:23 +0000 Subject: [PATCH 1/5] Update copy when the user verifies their own devices --- .../views/dialogs/IncomingSasDialog.js | 40 ++++++++++++++----- src/i18n/strings/en_EN.json | 2 + 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/components/views/dialogs/IncomingSasDialog.js b/src/components/views/dialogs/IncomingSasDialog.js index 3bf7b83291..1221e0cb91 100644 --- a/src/components/views/dialogs/IncomingSasDialog.js +++ b/src/components/views/dialogs/IncomingSasDialog.js @@ -121,6 +121,8 @@ export default class IncomingSasDialog extends React.Component { const Spinner = sdk.getComponent("views.elements.Spinner"); const BaseAvatar = sdk.getComponent("avatars.BaseAvatar"); + const isSelf = this.props.verifier.userId == MatrixClientPeg.get().credentials.userId; + let profile; if (this.state.opponentProfile) { profile =
@@ -148,20 +150,36 @@ export default class IncomingSasDialog extends React.Component { profile = ; } + const userDetailText = [ +

{_t( + "Verify this user to mark them as trusted. " + + "Trusting users gives you extra peace of mind when using " + + "end-to-end encrypted messages.", + )}

, +

{_t( + // NB. Below wording adjusted to singular 'session' until we have + // cross-signing + "Verifying this user will mark their session as trusted, and " + + "also mark your session as trusted to them.", + )}

+ ]; + + const selfDetailText = [ +

{_t( + "Verify this device to mark it as trusted. " + + "Trusting this device gives you and other users extra peace of mind when using " + + "end-to-end encrypted messages.", + )}

, +

{_t( + "Verifying this device will mark it as trusted, and users who have verified with " + + "you will trust this device.", + )}

+ ]; + return (
{profile} -

{_t( - "Verify this user to mark them as trusted. " + - "Trusting users gives you extra peace of mind when using " + - "end-to-end encrypted messages.", - )}

-

{_t( - // NB. Below wording adjusted to singular 'session' until we have - // cross-signing - "Verifying this user will mark their session as trusted, and " + - "also mark your session as trusted to them.", - )}

+ {isSelf ? selfDetailText : userDetailText} Date: Thu, 30 Jan 2020 16:11:05 +0000 Subject: [PATCH 2/5] copy for verification screen --- .../views/dialogs/DeviceVerifyDialog.js | 1 + .../views/dialogs/IncomingSasDialog.js | 3 ++- .../views/verification/VerificationShowSas.js | 21 +++++++++++++------ src/i18n/strings/en_EN.json | 2 ++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/components/views/dialogs/DeviceVerifyDialog.js b/src/components/views/dialogs/DeviceVerifyDialog.js index 4d0abdc848..d78ef3ca83 100644 --- a/src/components/views/dialogs/DeviceVerifyDialog.js +++ b/src/components/views/dialogs/DeviceVerifyDialog.js @@ -233,6 +233,7 @@ export default class DeviceVerifyDialog extends React.Component { sas={this._showSasEvent.sas} onCancel={this._onCancelClick} onDone={this._onSasMatchesClick} + isSelf={MatrixClientPeg.get().getUserId() === this.props.userId} />; } diff --git a/src/components/views/dialogs/IncomingSasDialog.js b/src/components/views/dialogs/IncomingSasDialog.js index 1221e0cb91..0095a0cb93 100644 --- a/src/components/views/dialogs/IncomingSasDialog.js +++ b/src/components/views/dialogs/IncomingSasDialog.js @@ -121,7 +121,7 @@ export default class IncomingSasDialog extends React.Component { const Spinner = sdk.getComponent("views.elements.Spinner"); const BaseAvatar = sdk.getComponent("avatars.BaseAvatar"); - const isSelf = this.props.verifier.userId == MatrixClientPeg.get().credentials.userId; + const isSelf = this.props.verifier.userId == MatrixClientPeg.get().getUserId(); let profile; if (this.state.opponentProfile) { @@ -196,6 +196,7 @@ export default class IncomingSasDialog extends React.Component { sas={this._showSasEvent.sas} onCancel={this._onCancelClick} onDone={this._onSasMatchesClick} + isSelf={this.props.verifier.userId == MatrixClientPeg.get().getUserId()} />; } diff --git a/src/components/views/verification/VerificationShowSas.js b/src/components/views/verification/VerificationShowSas.js index 38bc1bb40a..b92e72c3a7 100644 --- a/src/components/views/verification/VerificationShowSas.js +++ b/src/components/views/verification/VerificationShowSas.js @@ -32,6 +32,7 @@ export default class VerificationShowSas extends React.Component { onDone: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, sas: PropTypes.object.isRequired, + isSelf: PropTypes.bool, }; constructor(props) { @@ -66,9 +67,13 @@ export default class VerificationShowSas extends React.Component {
{emojiBlocks.slice(4)}
; - sasCaption = _t( - "Verify this user by confirming the following emoji appear on their screen.", - ); + sasCaption = this.props.isSelf ? + _t( + "Verify the device by confirming the following emoji appers on its screen.", + ): + _t( + "Verify this user by confirming the following emoji appear on their screen.", + ); } else if (this.props.sas.decimal) { const numberBlocks = this.props.sas.decimal.map((num, i) => {num} @@ -76,9 +81,13 @@ export default class VerificationShowSas extends React.Component { sasDisplay =
{numberBlocks}
; - sasCaption = _t( - "Verify this user by confirming the following number appears on their screen.", - ); + sasCaption = this.props.isSelf ? + _t( + "Verify this device by confirming the following number appears on its screen.", + ): + _t( + "Verify this user by confirming the following number appears on their screen.", + ); } else { return
{_t("Unable to find a supported verification method.")} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 595ef689a7..439614d2a8 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -444,7 +444,9 @@ "You've successfully verified this user.": "You've successfully verified this user.", "Secure messages with this user are end-to-end encrypted and not able to be read by third parties.": "Secure messages with this user are end-to-end encrypted and not able to be read by third parties.", "Got It": "Got It", + "Verify the device by confirming the following emoji appers on its screen.": "Verify the device by confirming the following emoji appers on its screen.", "Verify this user by confirming the following emoji appear on their screen.": "Verify this user by confirming the following emoji appear on their screen.", + "Verify this device by confirming the following number appears on its screen.": "Verify this device by confirming the following number appears on its screen.", "Verify this user by confirming the following number appears on their screen.": "Verify this user by confirming the following number appears on their screen.", "Unable to find a supported verification method.": "Unable to find a supported verification method.", "Cancel": "Cancel", From a9d85e1fa33cfb0ba2ddf59421b119078166fe90 Mon Sep 17 00:00:00 2001 From: Zoe Date: Thu, 30 Jan 2020 16:27:35 +0000 Subject: [PATCH 3/5] lint --- src/components/views/dialogs/IncomingSasDialog.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/views/dialogs/IncomingSasDialog.js b/src/components/views/dialogs/IncomingSasDialog.js index 0095a0cb93..c612043919 100644 --- a/src/components/views/dialogs/IncomingSasDialog.js +++ b/src/components/views/dialogs/IncomingSasDialog.js @@ -151,29 +151,29 @@ export default class IncomingSasDialog extends React.Component { } const userDetailText = [ -

{_t( +

{_t( "Verify this user to mark them as trusted. " + "Trusting users gives you extra peace of mind when using " + "end-to-end encrypted messages.", )}

, -

{_t( +

{_t( // NB. Below wording adjusted to singular 'session' until we have // cross-signing "Verifying this user will mark their session as trusted, and " + "also mark your session as trusted to them.", - )}

+ )}

, ]; const selfDetailText = [ -

{_t( +

{_t( "Verify this device to mark it as trusted. " + "Trusting this device gives you and other users extra peace of mind when using " + "end-to-end encrypted messages.", )}

, -

{_t( +

{_t( "Verifying this device will mark it as trusted, and users who have verified with " + "you will trust this device.", - )}

+ )}

, ]; return ( From f787bde80a9ea824b702232bcb888e69b8e1c4ef Mon Sep 17 00:00:00 2001 From: Zoe Date: Thu, 30 Jan 2020 16:36:57 +0000 Subject: [PATCH 4/5] copy --- src/components/views/verification/VerificationShowSas.js | 2 +- src/i18n/strings/en_EN.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/verification/VerificationShowSas.js b/src/components/views/verification/VerificationShowSas.js index b92e72c3a7..25f174fb30 100644 --- a/src/components/views/verification/VerificationShowSas.js +++ b/src/components/views/verification/VerificationShowSas.js @@ -69,7 +69,7 @@ export default class VerificationShowSas extends React.Component {
; sasCaption = this.props.isSelf ? _t( - "Verify the device by confirming the following emoji appers on its screen.", + "Confirm the emoji below are displayed on both devices, in the same order:", ): _t( "Verify this user by confirming the following emoji appear on their screen.", diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 439614d2a8..558e5220a3 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -444,7 +444,7 @@ "You've successfully verified this user.": "You've successfully verified this user.", "Secure messages with this user are end-to-end encrypted and not able to be read by third parties.": "Secure messages with this user are end-to-end encrypted and not able to be read by third parties.", "Got It": "Got It", - "Verify the device by confirming the following emoji appers on its screen.": "Verify the device by confirming the following emoji appers on its screen.", + "Confirm the emoji below are displayed on both devices, in the same order:": "Confirm the emoji below are displayed on both devices, in the same order:", "Verify this user by confirming the following emoji appear on their screen.": "Verify this user by confirming the following emoji appear on their screen.", "Verify this device by confirming the following number appears on its screen.": "Verify this device by confirming the following number appears on its screen.", "Verify this user by confirming the following number appears on their screen.": "Verify this user by confirming the following number appears on their screen.", From e58b59c26e198b512471e157d1d120b5d9fa9262 Mon Sep 17 00:00:00 2001 From: Zoe Date: Thu, 30 Jan 2020 16:41:25 +0000 Subject: [PATCH 5/5] don't tell users to verify themselves in person --- src/components/views/verification/VerificationShowSas.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/verification/VerificationShowSas.js b/src/components/views/verification/VerificationShowSas.js index 25f174fb30..4d3c962385 100644 --- a/src/components/views/verification/VerificationShowSas.js +++ b/src/components/views/verification/VerificationShowSas.js @@ -117,7 +117,9 @@ export default class VerificationShowSas extends React.Component { return

{sasCaption}

{sasDisplay} -

{_t("To be secure, do this in person or use a trusted way to communicate.")}

+

{this.props.isSelf ? + "": + _t("To be secure, do this in person or use a trusted way to communicate.")}

{confirm}
; }