hunnichat/lib/utils/other_party_can_receive.dart
mowetentertainment1 8ee77e3548
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
12/6/2025
2025-12-06 12:46:34 -05:00

22 lines
569 B
Dart

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 {}