diff --git a/src/components/views/right_panel/UserInfo.js b/src/components/views/right_panel/UserInfo.js
index 28b5af358a..c61746293e 100644
--- a/src/components/views/right_panel/UserInfo.js
+++ b/src/components/views/right_panel/UserInfo.js
@@ -64,6 +64,17 @@ const _getE2EStatus = (devices) => {
return hasUnverifiedDevice ? "warning" : "verified";
};
+async function unverifyUser(matrixClient, userId) {
+ const devices = await matrixClient.getStoredDevicesForUser(userId);
+ for (const device of devices) {
+ if (device.isVerified()) {
+ matrixClient.setDeviceVerified(
+ userId, device.deviceId, false,
+ );
+ }
+ }
+}
+
function useIsEncrypted(cli, room) {
const [isEncrypted, setIsEncrypted] = useState(cli.isRoomEncrypted(room.roomId));
@@ -124,7 +135,7 @@ function openDMForUser(cli, userId) {
}
}
-const UserOptionsSection = withLegacyMatrixClient(({matrixClient: cli, member, isIgnored, canInvite}) => {
+const UserOptionsSection = withLegacyMatrixClient(({matrixClient: cli, member, isIgnored, canInvite, devices}) => {
let ignoreButton = null;
let insertPillButton = null;
let inviteUserButton = null;
@@ -234,6 +245,14 @@ const UserOptionsSection = withLegacyMatrixClient(({matrixClient: cli, member, i
);
}
+ let unverifyButton;
+ if (devices && devices.some(device => device.isVerified())) {
+ unverifyButton = (
+