feat: Prevent sending messages if other party has no encryption keys

This commit is contained in:
Krille 2025-01-13 13:57:12 +01:00
commit aa010767de
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
5 changed files with 60 additions and 1 deletions

View file

@ -12,6 +12,7 @@ import 'package:mime/mime.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/utils/localized_exception_extension.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_file_extension.dart';
import 'package:fluffychat/utils/other_party_can_receive.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/size_string.dart';
import 'package:fluffychat/widgets/adaptive_dialogs/adaptive_dialog_action.dart';
@ -44,6 +45,9 @@ class SendFileDialogState extends State<SendFileDialog> {
final l10n = L10n.of(context);
try {
if (!widget.room.otherPartyCanReceiveMessages) {
throw OtherPartyCanNotReceiveMessages();
}
scaffoldMessenger.showLoadingSnackBar(l10n.prepareSendingAttachment);
Navigator.of(context, rootNavigator: false).pop();
final clientConfig = await widget.room.client.getConfig();