You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
569 B
Dart
22 lines
569 B
Dart
2 months ago
|
import 'package:matrix/matrix.dart';
|
||
|
|
||
|
extension OtherPartyCanReceiveExtension on Room {
|
||
|
bool get otherPartyCanReceiveMessages {
|
||
|
if (!encrypted) return true;
|
||
|
final users = getParticipants()
|
||
|
.map((u) => u.id)
|
||
|
.where((userId) => userId != client.userID)
|
||
|
.toSet();
|
||
|
if (users.isEmpty) return true;
|
||
|
|
||
|
for (final userId in users) {
|
||
|
if (client.userDeviceKeys[userId]?.deviceKeys.values.isNotEmpty == true) {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class OtherPartyCanNotReceiveMessages implements Exception {}
|