From 41f4b38fe8a3f9a8bd2b5e12b591ec218e5ecbb4 Mon Sep 17 00:00:00 2001 From: Zoe Date: Mon, 3 Feb 2020 16:51:36 +0000 Subject: [PATCH] Do not show alarming red shields on large encrypted rooms for your own device Fixes: https://github.com/vector-im/riot-web/issues/12214 --- src/components/structures/RoomView.js | 4 +++- src/components/views/rooms/RoomTile.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 24eaa7a410..acc87d9616 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -811,7 +811,9 @@ export default createReactClass({ debuglog("e2e verified", verified, "unverified", unverified); /* Check all verified user devices. */ - for (const userId of [...verified, cli.getUserId()]) { + /* Don't alarm if no other users are verified */ + const targets = (verified.length > 0) ? [...verified, cli.getUserId()] : verified; + for (const userId of targets) { const devices = await cli.getStoredDevicesForUser(userId); const anyDeviceNotVerified = devices.some(({deviceId}) => { return !cli.checkDeviceTrust(userId, deviceId).isVerified(); diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 41d43476ea..393ed0976f 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -166,7 +166,9 @@ export default createReactClass({ }); /* Check all verified user devices. */ - for (const userId of [...verified, cli.getUserId()]) { + /* Don't alarm if no other users are verified */ + const targets = (verified.length > 0) ? [...verified, cli.getUserId()] : verified; + for (const userId of targets) { const devices = await cli.getStoredDevicesForUser(userId); const allDevicesVerified = devices.every(({deviceId}) => { return cli.checkDeviceTrust(userId, deviceId).isVerified();