mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Merge pull request #4181 from matrix-org/bwindels/bringbacklegacyverififnoxsignkeys
Fall back to to_device verification if other user hasn't uploaded cross-signing keys
This commit is contained in:
commit
1e95048018
1 changed files with 18 additions and 2 deletions
|
@ -186,6 +186,16 @@ async function verifyDevice(userId, device) {
|
|||
});
|
||||
}
|
||||
|
||||
async function legacyVerifyUser(member) {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const verificationRequestPromise = cli.requestVerification(member.userId);
|
||||
dis.dispatch({
|
||||
action: "set_right_panel_phase",
|
||||
phase: RIGHT_PANEL_PHASES.EncryptionPanel,
|
||||
refireParams: {member, verificationRequestPromise},
|
||||
});
|
||||
}
|
||||
|
||||
function verifyUser(user) {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const dmRoom = findDMForUser(cli, user.userId);
|
||||
|
@ -1355,9 +1365,15 @@ const BasicUserInfo = ({room, member, groupId, devices, isRoomEncrypted}) => {
|
|||
const hasCrossSigningKeys =
|
||||
useHasCrossSigningKeys(cli, member, canVerify, setUpdating );
|
||||
|
||||
if (canVerify && hasCrossSigningKeys) {
|
||||
if (canVerify) {
|
||||
verifyButton = (
|
||||
<AccessibleButton className="mx_UserInfo_field" onClick={() => verifyUser(member)}>
|
||||
<AccessibleButton className="mx_UserInfo_field" onClick={() => {
|
||||
if (hasCrossSigningKeys) {
|
||||
verifyUser(member);
|
||||
} else {
|
||||
legacyVerifyUser(member);
|
||||
}
|
||||
}}>
|
||||
{_t("Verify")}
|
||||
</AccessibleButton>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue