Skip to content

Commit

Permalink
chore: Follow up other party has no keys
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Jan 13, 2025
1 parent aa01076 commit 2fef6fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/pages/chat/send_file_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,15 @@ class SendFileDialogState extends State<SendFileDialog> {
scaffoldMessenger.clearSnackBars();
} catch (e) {
scaffoldMessenger.clearSnackBars();
final theme = Theme.of(context);
scaffoldMessenger.showSnackBar(
SnackBar(
content: Text(e.toLocalizedString(widget.outerContext)),
backgroundColor: theme.colorScheme.errorContainer,
closeIconColor: theme.colorScheme.onErrorContainer,
content: Text(
e.toLocalizedString(widget.outerContext),
style: TextStyle(color: theme.colorScheme.onErrorContainer),
),
duration: const Duration(seconds: 30),
showCloseIcon: true,
),
Expand Down
4 changes: 4 additions & 0 deletions lib/utils/localized_exception_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:http/http.dart';
import 'package:matrix/encryption.dart';
import 'package:matrix/matrix.dart';

import 'package:fluffychat/utils/other_party_can_receive.dart';
import 'uia_request_manager.dart';

extension LocalizedExceptionExtension on Object {
Expand All @@ -34,6 +35,9 @@ extension LocalizedExceptionExtension on Object {
_formatFileSize(exception.maxFileSize),
);
}
if (this is OtherPartyCanNotReceiveMessages) {
return L10n.of(context).otherPartyNotLoggedIn;
}
if (this is MatrixException) {
switch ((this as MatrixException).error) {
case MatrixError.M_FORBIDDEN:
Expand Down

0 comments on commit 2fef6fa

Please sign in to comment.