From 775b22389d26b9e19e9f4395121a1da82c09b690 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Tue, 18 Feb 2020 08:13:20 +0100 Subject: [PATCH] Show decrypt error --- lib/components/message_content.dart | 13 +++++++++++++ lib/utils/event_extension.dart | 4 ++++ pubspec.lock | 6 +++--- pubspec.yaml | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/components/message_content.dart b/lib/components/message_content.dart index 49e1fb2..62f0d5b 100644 --- a/lib/components/message_content.dart +++ b/lib/components/message_content.dart @@ -127,6 +127,19 @@ class MessageContent extends StatelessWidget { ), ), ); + case MessageTypes.BadEncrypted: + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.lock), + Text( + event.getLocalizedBody(context), + style: TextStyle( + color: textColor, + ), + ), + ], + ); case MessageTypes.Text: case MessageTypes.Reply: case MessageTypes.Location: diff --git a/lib/utils/event_extension.dart b/lib/utils/event_extension.dart index 0ffccc4..35ec535 100644 --- a/lib/utils/event_extension.dart +++ b/lib/utils/event_extension.dart @@ -193,6 +193,10 @@ extension LocalizedBody on Event { case MessageTypes.Emote: localizedBody = "* $body"; break; + case MessageTypes.BadEncrypted: + localizedBody = + I18n.of(context).couldNotDecryptMessage + ": " + body; + break; case MessageTypes.Text: case MessageTypes.Notice: case MessageTypes.None: diff --git a/pubspec.lock b/pubspec.lock index 44370ee..e446727 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -124,8 +124,8 @@ packages: dependency: "direct main" description: path: "." - ref: d6e59370668c697a97fefea32c0cdedfb235203b - resolved-ref: d6e59370668c697a97fefea32c0cdedfb235203b + ref: "083dd8eb295f0c6624e78d54f2ffeaa30de5de41" + resolved-ref: "083dd8eb295f0c6624e78d54f2ffeaa30de5de41" url: "https://gitlab.com/famedly/famedlysdk.git" source: git version: "0.0.1" @@ -274,7 +274,7 @@ packages: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.16.0" + version: "0.16.1" intl_translation: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 842edff..a862e8a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: famedlysdk: git: url: https://gitlab.com/famedly/famedlysdk.git - ref: bf23664ccd106fd46ec95a57fb9434a056f8c1a9 + ref: 083dd8eb295f0c6624e78d54f2ffeaa30de5de41 localstorage: ^3.0.1+4 bubble: ^1.1.9+1