1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

track whether we blacklist unverified devices per-room & globally

This commit is contained in:
Matthew Hodgson
2017-01-21 17:38:35 +00:00
parent e79926db6c
commit 512d5882c9
5 changed files with 63 additions and 2 deletions

View File

@@ -476,7 +476,7 @@ MegolmEncryption.prototype._getDevicesInRoom = function(room) {
// XXX: what if the cache is stale, and the user left the room we had in common
// and then added new devices before joining this one? --Matthew
return this._crypto.downloadKeys(roomMembers, false).then(function(devices) {
// remove any blocked devices
// remove any blocked (aka blacklisted) devices
for (const userId in devices) {
if (!devices.hasOwnProperty(userId)) {
continue;
@@ -487,7 +487,11 @@ MegolmEncryption.prototype._getDevicesInRoom = function(room) {
if (!userDevices.hasOwnProperty(deviceId)) {
continue;
}
if (userDevices[deviceId].isBlocked()) {
if (userDevices[deviceId].isBlocked() ||
(userDevices[deviceId].isUnverified() &&
room.getBlacklistUnverifiedDevices()))
{
delete userDevices[deviceId];
}
}