try...catch fetching all encrypted devices, in case we aren't in a room

This commit is contained in:
Sorunome 2020-08-01 18:18:30 +02:00
parent fe700b229c
commit e1fa4983d0

View file

@ -1159,12 +1159,17 @@ class Client {
var userIds = <String>{}; var userIds = <String>{};
for (var i = 0; i < rooms.length; i++) { for (var i = 0; i < rooms.length; i++) {
if (rooms[i].encrypted) { if (rooms[i].encrypted) {
try {
var userList = await rooms[i].requestParticipants(); var userList = await rooms[i].requestParticipants();
for (var user in userList) { for (var user in userList) {
if ([Membership.join, Membership.invite].contains(user.membership)) { if ([Membership.join, Membership.invite]
.contains(user.membership)) {
userIds.add(user.id); userIds.add(user.id);
} }
} }
} catch (err) {
print('[E2EE] Failed to fetch participants: ' + err.toString());
}
} }
} }
return userIds; return userIds;