mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08: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
@ -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) {
|
function verifyUser(user) {
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
const dmRoom = findDMForUser(cli, user.userId);
|
const dmRoom = findDMForUser(cli, user.userId);
|
||||||
@ -1355,9 +1365,15 @@ const BasicUserInfo = ({room, member, groupId, devices, isRoomEncrypted}) => {
|
|||||||
const hasCrossSigningKeys =
|
const hasCrossSigningKeys =
|
||||||
useHasCrossSigningKeys(cli, member, canVerify, setUpdating );
|
useHasCrossSigningKeys(cli, member, canVerify, setUpdating );
|
||||||
|
|
||||||
if (canVerify && hasCrossSigningKeys) {
|
if (canVerify) {
|
||||||
verifyButton = (
|
verifyButton = (
|
||||||
<AccessibleButton className="mx_UserInfo_field" onClick={() => verifyUser(member)}>
|
<AccessibleButton className="mx_UserInfo_field" onClick={() => {
|
||||||
|
if (hasCrossSigningKeys) {
|
||||||
|
verifyUser(member);
|
||||||
|
} else {
|
||||||
|
legacyVerifyUser(member);
|
||||||
|
}
|
||||||
|
}}>
|
||||||
{_t("Verify")}
|
{_t("Verify")}
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user