From d098c91c3043d319a89ce047e9439cc92f05695c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 25 Mar 2020 22:38:11 +0000 Subject: [PATCH 1/3] Update cross-signing verification copy and fix i18n Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/right_panel/EncryptionInfo.js | 22 +++++++++++++++---- .../views/right_panel/EncryptionPanel.js | 5 ++++- src/components/views/right_panel/UserInfo.js | 5 ++--- .../views/right_panel/VerificationPanel.js | 16 ++++++++++---- src/i18n/strings/en_EN.json | 8 ++++++- 5 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/components/views/right_panel/EncryptionInfo.js b/src/components/views/right_panel/EncryptionInfo.js index bbedc9b303..610ea99511 100644 --- a/src/components/views/right_panel/EncryptionInfo.js +++ b/src/components/views/right_panel/EncryptionInfo.js @@ -28,7 +28,7 @@ export const PendingActionSpinner = ({text}) => { ; }; -const EncryptionInfo = ({waitingForOtherParty, waitingForNetwork, member, onStartVerification}) => { +const EncryptionInfo = ({waitingForOtherParty, waitingForNetwork, member, onStartVerification, isRoomEncrypted}) => { let content; if (waitingForOtherParty || waitingForNetwork) { let text; @@ -49,13 +49,27 @@ const EncryptionInfo = ({waitingForOtherParty, waitingForNetwork, member, onStar ); } - return -
-

{_t("Encryption")}

+ let description; + if (isRoomEncrypted) { + description = (

{_t("Messages in this room are end-to-end encrypted.")}

{_t("Your messages are secured and only you and the recipient have the unique keys to unlock them.")}

+ ); + } else { + description = ( +
+

{_t("Messages in this room are not end-to-end encrypted.")}

+

{_t("In encrypted rooms, your messages are secured and only you and the recipient have the unique keys to unlock them.")}

+
+ ); + } + + return +
+

{_t("Encryption")}

+ { description }

{_t("Verify User")}

diff --git a/src/components/views/right_panel/EncryptionPanel.js b/src/components/views/right_panel/EncryptionPanel.js index a14d4a2b7d..3a4aa2edc3 100644 --- a/src/components/views/right_panel/EncryptionPanel.js +++ b/src/components/views/right_panel/EncryptionPanel.js @@ -30,7 +30,8 @@ import {_t} from "../../../languageHandler"; // cancellation codes which constitute a key mismatch const MISMATCHES = ["m.key_mismatch", "m.user_error", "m.mismatched_sas"]; -const EncryptionPanel = ({verificationRequest, verificationRequestPromise, member, onClose, layout}) => { +const EncryptionPanel = (props) => { + const {verificationRequest, verificationRequestPromise, member, onClose, layout, isRoomEncrypted} = props; const [request, setRequest] = useState(verificationRequest); // state to show a spinner immediately after clicking "start verification", // before we have a request @@ -98,6 +99,7 @@ const EncryptionPanel = ({verificationRequest, verificationRequestPromise, membe if (!request || requested) { const initiatedByMe = (!request && isRequesting) || (request && request.initiatedByMe); return { const userVerified = userTrust.isCrossSigningVerified(); const isMe = member.userId === cli.getUserId(); const canVerify = SettingsStore.isFeatureEnabled("feature_cross_signing") && - homeserverSupportsCrossSigning && - isRoomEncrypted && !userVerified && !isMe; + homeserverSupportsCrossSigning && !userVerified && !isMe; const setUpdating = (updating) => { setPendingUpdateCount(count => count + (updating ? 1 : -1)); @@ -1496,7 +1495,7 @@ const UserInfo = ({user, groupId, roomId, onClose, phase=RIGHT_PANEL_PHASES.Room case RIGHT_PANEL_PHASES.EncryptionPanel: classes.push("mx_UserInfo_smallAvatar"); content = ( - + ); break; } diff --git a/src/components/views/right_panel/VerificationPanel.js b/src/components/views/right_panel/VerificationPanel.js index 38ee31c8b7..a5cb796531 100644 --- a/src/components/views/right_panel/VerificationPanel.js +++ b/src/components/views/right_panel/VerificationPanel.js @@ -48,6 +48,7 @@ export default class VerificationPanel extends React.PureComponent { PHASE_DONE, ]).isRequired, onClose: PropTypes.func.isRequired, + isRoomEncrypted: PropTypes.bool, }; constructor(props) { @@ -174,15 +175,22 @@ export default class VerificationPanel extends React.PureComponent { renderVerifiedPhase() { const {member} = this.props; + let text; + if (this.props.isRoomEncrypted) { + text = _t("Verify all users in a room to ensure it's secure."); + } else { + text = _t("In encrypted rooms, verify all users in a room to ensure it’s secure."); + } + const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); return (
-

Verified

+

{_t("Verified")}

{_t("You've successfully verified %(displayName)s!", { displayName: member.displayName || member.name || member.userId, })}

-

Verify all users in a room to ensure it's secure.

+

{ text }

{_t("Got it")} @@ -209,7 +217,7 @@ export default class VerificationPanel extends React.PureComponent { return (
-

Verification cancelled

+

{_t("Verification cancelled")}

{ text }

@@ -231,7 +239,7 @@ export default class VerificationPanel extends React.PureComponent { if (this.state.sasEvent) { const VerificationShowSas = sdk.getComponent('views.verification.VerificationShowSas'); return
-

Compare emoji

+

{_t("Compare emoji")}

%(role)s in %(roomName)s": "%(role)s in %(roomName)s", "This client does not support end-to-end encryption.": "This client does not support end-to-end encryption.", - "Messages in this room are not end-to-end encrypted.": "Messages in this room are not end-to-end encrypted.", "Security": "Security", "The session you are trying to verify doesn't support scanning a QR code or emoji verification, which is what Riot supports. Try with a different client.": "The session you are trying to verify doesn't support scanning a QR code or emoji verification, which is what Riot supports. Try with a different client.", "Verify by scanning": "Verify by scanning", @@ -1233,11 +1234,16 @@ "Verify by emoji": "Verify by emoji", "If you can't scan the code above, verify by comparing unique emoji.": "If you can't scan the code above, verify by comparing unique emoji.", "Verify by comparing unique emoji.": "Verify by comparing unique emoji.", + "Verify all users in a room to ensure it's secure.": "Verify all users in a room to ensure it's secure.", + "In encrypted rooms, verify all users in a room to ensure it’s secure.": "In encrypted rooms, verify all users in a room to ensure it’s secure.", + "Verified": "Verified", "You've successfully verified %(displayName)s!": "You've successfully verified %(displayName)s!", "Got it": "Got it", "Verification timed out. Start verification again from their profile.": "Verification timed out. Start verification again from their profile.", "%(displayName)s cancelled verification. Start verification again from their profile.": "%(displayName)s cancelled verification. Start verification again from their profile.", "You cancelled verification. Start verification again from their profile.": "You cancelled verification. Start verification again from their profile.", + "Verification cancelled": "Verification cancelled", + "Compare emoji": "Compare emoji", "Sunday": "Sunday", "Monday": "Monday", "Tuesday": "Tuesday", From be3167c87042e65ae38aadd11655031670f3ea7c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 25 Mar 2020 22:44:09 +0000 Subject: [PATCH 2/3] always show Devices section Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/right_panel/UserInfo.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/components/views/right_panel/UserInfo.js b/src/components/views/right_panel/UserInfo.js index 3a415fa8a7..34d0047892 100644 --- a/src/components/views/right_panel/UserInfo.js +++ b/src/components/views/right_panel/UserInfo.js @@ -1319,20 +1319,15 @@ const BasicUserInfo = ({room, member, groupId, devices, isRoomEncrypted}) => { ); } - let devicesSection; - if (isRoomEncrypted) { - devicesSection = ; - } - const securitySection = (

{ _t("Security") }

{ text }

{ verifyButton } - { devicesSection } +
); From 7ca6a4b7770e1b2940d60791cceff8432a851c8e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 25 Mar 2020 23:00:46 +0000 Subject: [PATCH 3/3] Iterate copy Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/right_panel/VerificationPanel.js | 2 +- src/i18n/strings/en_EN.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/right_panel/VerificationPanel.js b/src/components/views/right_panel/VerificationPanel.js index a5cb796531..1cb2737005 100644 --- a/src/components/views/right_panel/VerificationPanel.js +++ b/src/components/views/right_panel/VerificationPanel.js @@ -179,7 +179,7 @@ export default class VerificationPanel extends React.PureComponent { if (this.props.isRoomEncrypted) { text = _t("Verify all users in a room to ensure it's secure."); } else { - text = _t("In encrypted rooms, verify all users in a room to ensure it’s secure."); + text = _t("In encrypted rooms, verify all users to ensure it’s secure."); } const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7dec09d30a..ef6dc6d821 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1235,7 +1235,7 @@ "If you can't scan the code above, verify by comparing unique emoji.": "If you can't scan the code above, verify by comparing unique emoji.", "Verify by comparing unique emoji.": "Verify by comparing unique emoji.", "Verify all users in a room to ensure it's secure.": "Verify all users in a room to ensure it's secure.", - "In encrypted rooms, verify all users in a room to ensure it’s secure.": "In encrypted rooms, verify all users in a room to ensure it’s secure.", + "In encrypted rooms, verify all users to ensure it’s secure.": "In encrypted rooms, verify all users to ensure it’s secure.", "Verified": "Verified", "You've successfully verified %(displayName)s!": "You've successfully verified %(displayName)s!", "Got it": "Got it",