for self-verif, mention which device, not user we're verifying in panel
This commit is contained in:
parent
2ee780caa2
commit
030d594e67
3 changed files with 29 additions and 6 deletions
|
@ -22,6 +22,7 @@ import VerificationPanel from "./VerificationPanel";
|
||||||
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
||||||
import {ensureDMExists} from "../../../createRoom";
|
import {ensureDMExists} from "../../../createRoom";
|
||||||
import {useEventEmitter} from "../../../hooks/useEventEmitter";
|
import {useEventEmitter} from "../../../hooks/useEventEmitter";
|
||||||
|
import {useAsyncMemo} from "../../../hooks/useAsyncMemo";
|
||||||
import Modal from "../../../Modal";
|
import Modal from "../../../Modal";
|
||||||
import {PHASE_REQUESTED, PHASE_UNSENT} from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest";
|
import {PHASE_REQUESTED, PHASE_UNSENT} from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest";
|
||||||
import * as sdk from "../../../index";
|
import * as sdk from "../../../index";
|
||||||
|
@ -45,6 +46,12 @@ const EncryptionPanel = (props) => {
|
||||||
}
|
}
|
||||||
}, [verificationRequest]);
|
}, [verificationRequest]);
|
||||||
|
|
||||||
|
const deviceId = request && request.channel.deviceId;
|
||||||
|
const device = useAsyncMemo(() => {
|
||||||
|
const cli = MatrixClientPeg.get();
|
||||||
|
return cli.getStoredDevice(cli.getUserId(), deviceId);
|
||||||
|
}, [deviceId]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function awaitPromise() {
|
async function awaitPromise() {
|
||||||
setRequesting(true);
|
setRequesting(true);
|
||||||
|
@ -139,7 +146,8 @@ const EncryptionPanel = (props) => {
|
||||||
request={request}
|
request={request}
|
||||||
key={request.channel.transactionId}
|
key={request.channel.transactionId}
|
||||||
inDialog={inDialog}
|
inDialog={inDialog}
|
||||||
phase={phase} />
|
phase={phase}
|
||||||
|
device={device} />
|
||||||
</React.Fragment>);
|
</React.Fragment>);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -210,12 +210,19 @@ export default class VerificationPanel extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
|
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
|
||||||
|
const description = request.isSelfVerification ?
|
||||||
|
_t("You've successfully verified %(deviceName)s (%(deviceId)s)!", {
|
||||||
|
deviceName: this.props.device.getDisplayName(),
|
||||||
|
deviceId: this.props.device.deviceId,
|
||||||
|
}):
|
||||||
|
_t("You've successfully verified %(displayName)s!", {
|
||||||
|
displayName: member.displayName || member.name || member.userId,
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_UserInfo_container mx_VerificationPanel_verified_section">
|
<div className="mx_UserInfo_container mx_VerificationPanel_verified_section">
|
||||||
<h3>{_t("Verified")}</h3>
|
<h3>{_t("Verified")}</h3>
|
||||||
<p>{_t("You've successfully verified %(displayName)s!", {
|
<p>{description}</p>
|
||||||
displayName: member.displayName || member.name || member.userId,
|
|
||||||
})}</p>
|
|
||||||
<E2EIcon isUser={true} status="verified" size={128} hideTooltip={true} />
|
<E2EIcon isUser={true} status="verified" size={128} hideTooltip={true} />
|
||||||
<p>{ text }</p>
|
<p>{ text }</p>
|
||||||
|
|
||||||
|
@ -276,6 +283,7 @@ export default class VerificationPanel extends React.PureComponent {
|
||||||
onDone={this._onSasMatchesClick}
|
onDone={this._onSasMatchesClick}
|
||||||
inDialog={this.props.inDialog}
|
inDialog={this.props.inDialog}
|
||||||
isSelf={request.isSelfVerification}
|
isSelf={request.isSelfVerification}
|
||||||
|
device={this.props.device}
|
||||||
/> : <Spinner />;
|
/> : <Spinner />;
|
||||||
return <div className="mx_UserInfo_container">
|
return <div className="mx_UserInfo_container">
|
||||||
<h3>{_t("Compare emoji")}</h3>
|
<h3>{_t("Compare emoji")}</h3>
|
||||||
|
|
|
@ -107,8 +107,15 @@ export default class VerificationShowSas extends React.Component {
|
||||||
if (this.state.pending || this.state.cancelling) {
|
if (this.state.pending || this.state.cancelling) {
|
||||||
let text;
|
let text;
|
||||||
if (this.state.pending) {
|
if (this.state.pending) {
|
||||||
|
if (this.props.isSelf) {
|
||||||
|
text = _t("Waiting for your other session, %(deviceName)s (%(deviceId)s), to verify…", {
|
||||||
|
deviceName: this.props.device.getDisplayName(),
|
||||||
|
deviceId: this.props.device.deviceId,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
const {displayName} = this.props;
|
const {displayName} = this.props;
|
||||||
text = _t("Waiting for %(displayName)s to verify…", {displayName});
|
text = _t("Waiting for %(displayName)s to verify…", {displayName});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
text = _t("Cancelling…");
|
text = _t("Cancelling…");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue