1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

make it work

This commit is contained in:
Matthew Hodgson
2017-01-22 01:29:33 +01:00
parent d37935dd78
commit 3d30ad843f
2 changed files with 14 additions and 2 deletions

View File

@@ -475,7 +475,8 @@ 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) {
var self = this;
return self._crypto.downloadKeys(roomMembers, false).then(function(devices) {
// remove any blocked (aka blacklisted) devices
for (const userId in devices) {
if (!devices.hasOwnProperty(userId)) {
@@ -491,7 +492,7 @@ MegolmEncryption.prototype._getDevicesInRoom = function(room) {
if (userDevices[deviceId].isBlocked() ||
(userDevices[deviceId].isUnverified() &&
(room.getBlacklistUnverifiedDevices() ||
this._crypto.getGlobalBlacklistUnverifiedDevices())))
self._crypto.getGlobalBlacklistUnverifiedDevices())))
{
delete userDevices[deviceId];
}