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

@ -5,6 +5,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:matrix/matrix.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/utils/other_party_can_receive.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/matrix.dart';
@ -25,6 +26,20 @@ class ChatInputRow extends StatelessWidget {
return const SizedBox.shrink();
}
const height = 48.0;
if (!controller.room.otherPartyCanReceiveMessages) {
return Center(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
L10n.of(context).otherPartyNotLoggedIn,
style: theme.textTheme.bodySmall,
textAlign: TextAlign.center,
),
),
);
}
return Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,