diff --git a/src/components/views/messages/MKeyVerificationRequest.js b/src/components/views/messages/MKeyVerificationRequest.js index d02319119e..f49ae1b6b1 100644 --- a/src/components/views/messages/MKeyVerificationRequest.js +++ b/src/components/views/messages/MKeyVerificationRequest.js @@ -62,8 +62,8 @@ export default class MKeyVerificationRequest extends React.Component { const request = this.props.mxEvent.verificationRequest; if (request) { try { - await request.accept(); this._openRequest(); + await request.accept(); } catch (err) { console.error(err.message); } @@ -136,9 +136,9 @@ export default class MKeyVerificationRequest extends React.Component { } else if (request.cancelled) { stateLabel = this._cancelledLabel(request.cancellingUserId); } else if (request.accepting) { - stateLabel = _t("accepting …"); + stateLabel = _t("Accepting …"); } else if (request.declining) { - stateLabel = _t("declining …"); + stateLabel = _t("Declining …"); } stateNode = (
{stateLabel}
); } diff --git a/src/components/views/right_panel/EncryptionInfo.js b/src/components/views/right_panel/EncryptionInfo.js index 299e553769..bbedc9b303 100644 --- a/src/components/views/right_panel/EncryptionInfo.js +++ b/src/components/views/right_panel/EncryptionInfo.js @@ -28,12 +28,17 @@ export const PendingActionSpinner = ({text}) => { ; }; -const EncryptionInfo = ({pending, member, onStartVerification}) => { +const EncryptionInfo = ({waitingForOtherParty, waitingForNetwork, member, onStartVerification}) => { let content; - if (pending) { - const text = _t("Waiting for %(displayName)s to accept…", { - displayName: member.displayName || member.name || member.userId, - }); + if (waitingForOtherParty || waitingForNetwork) { + let text; + if (waitingForOtherParty) { + text = _t("Waiting for %(displayName)s to accept…", { + displayName: member.displayName || member.name || member.userId, + }); + } else { + text = _t("Accepting…"); + } content = ; } else { const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); diff --git a/src/components/views/right_panel/EncryptionPanel.js b/src/components/views/right_panel/EncryptionPanel.js index 24d2f9f010..3ba6ca9a8a 100644 --- a/src/components/views/right_panel/EncryptionPanel.js +++ b/src/components/views/right_panel/EncryptionPanel.js @@ -76,8 +76,13 @@ const EncryptionPanel = ({verificationRequest, member, onClose, layout}) => { }, [member.userId]); const requested = request && (phase === PHASE_REQUESTED || phase === PHASE_UNSENT || phase === undefined); + const initiatedByMe = request && request.initiatedByMe; if (!request || requested) { - return ; + return ; } else { return ( { + this.setState({ cancelling: true }); + this.props.onCancel(); + }; + render() { let sasDisplay; let sasCaption; @@ -98,9 +103,14 @@ export default class VerificationShowSas extends React.Component { } let confirm; - if (this.state.pending) { - const {displayName} = this.props; - const text = _t("Waiting for %(displayName)s to verify…", {displayName}); + if (this.state.pending || this.state.cancelling) { + let text; + if (this.state.pending) { + const {displayName} = this.props; + text = _t("Waiting for %(displayName)s to verify…", {displayName}); + } else { + text = _t("Cancelling…"); + } confirm = ; } else { // FIXME: stop using DialogButtons here once this component is only used in the right panel verification @@ -109,7 +119,7 @@ export default class VerificationShowSas extends React.Component { onPrimaryButtonClick={this.onMatchClick} primaryButtonClass="mx_UserInfo_wideButton" cancelButton={_t("They don't match")} - onCancel={this.props.onCancel} + onCancel={this.onDontMatchClick} cancelButtonClass="mx_UserInfo_wideButton" />; } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index f702da6b4c..79b045dd34 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -465,6 +465,7 @@ "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.", "Waiting for %(displayName)s to verify…": "Waiting for %(displayName)s to verify…", + "Cancelling…": "Cancelling…", "They match": "They match", "They don't match": "They don't match", "To be secure, do this in person or use a trusted way to communicate.": "To be secure, do this in person or use a trusted way to communicate.", @@ -1165,6 +1166,7 @@ "In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.": "In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.", "When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.": "When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.", "Waiting for %(displayName)s to accept…": "Waiting for %(displayName)s to accept…", + "Accepting…": "Accepting…", "Start Verification": "Start Verification", "Messages in this room are end-to-end encrypted.": "Messages in this room are end-to-end encrypted.", "Your messages are secured and only you and the recipient have the unique keys to unlock them.": "Your messages are secured and only you and the recipient have the unique keys to unlock them.", @@ -1248,8 +1250,8 @@ "You cancelled": "You cancelled", "%(name)s declined": "%(name)s declined", "%(name)s cancelled": "%(name)s cancelled", - "accepting …": "accepting …", - "declining …": "declining …", + "Accepting …": "Accepting …", + "Declining …": "Declining …", "%(name)s wants to verify": "%(name)s wants to verify", "You sent a verification request": "You sent a verification request", "Error decrypting video": "Error decrypting video",