dont check devices for left members

This commit is contained in:
Bruno Windels
2019-02-12 18:33:44 +01:00
parent 999ed1b5b3
commit a427e2a75c
+8 -3
View File
@@ -599,9 +599,14 @@ Room.prototype.hasUnverifiedDevices = async function() {
}
const memberIds = Object.keys(this.currentState.members);
for (const userId of memberIds) {
const devices = await this._client.getStoredDevicesForUser(userId);
if (devices.some((device) => device.isUnverified())) {
return true;
const membership = this.currentState.members[userId].membership;
// check for negative values rather than positive to be
// extra careful to not report false positives here
if (membership !== "leave") {
const devices = await this._client.getStoredDevicesForUser(userId);
if (devices.some((device) => device.isUnverified())) {
return true;
}
}
}
return false;