revert to legacy user verification (over to_device) without xsign keys

pull/21833/head
Bruno Windels 2020-03-06 17:37:01 +01:00
parent 64b757e302
commit 1f9bd55f3b
1 changed files with 18 additions and 2 deletions

View File

@ -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>
); );