ElementR: Cross user verification (#11364)
The hard work has been done in previous PRs in the js-sdk, so this is now just a case of updating a few call sites to use the new APIs.
This commit is contained in:
@@ -37,17 +37,15 @@ export async function shieldStatusForRoom(client: MatrixClient, room: Room): Pro
|
||||
|
||||
const verified: string[] = [];
|
||||
const unverified: string[] = [];
|
||||
members
|
||||
.filter((userId) => userId !== client.getUserId())
|
||||
.forEach((userId) => {
|
||||
(client.checkUserTrust(userId).isCrossSigningVerified() ? verified : unverified).push(userId);
|
||||
});
|
||||
for (const userId of members) {
|
||||
if (userId === client.getUserId()) continue;
|
||||
const userTrust = await crypto.getUserVerificationStatus(userId);
|
||||
|
||||
/* Alarm if any unverified users were verified before. */
|
||||
for (const userId of unverified) {
|
||||
if (client.checkUserTrust(userId).wasCrossSigningVerified()) {
|
||||
/* Alarm if any unverified users were verified before. */
|
||||
if (userTrust.wasCrossSigningVerified() && !userTrust.isCrossSigningVerified()) {
|
||||
return E2EStatus.Warning;
|
||||
}
|
||||
(userTrust.isCrossSigningVerified() ? verified : unverified).push(userId);
|
||||
}
|
||||
|
||||
/* Check all verified user devices. */
|
||||
|
||||
Reference in New Issue
Block a user