Update SDK

This commit is contained in:
Christian Pauly 2020-02-21 09:45:37 +01:00
parent 47d5b1a369
commit c6f5fcb5e8
5 changed files with 12 additions and 13 deletions

View file

@ -29,7 +29,8 @@ class Message extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (![EventTypes.Message, EventTypes.Sticker].contains(event.type)) { if (![EventTypes.Message, EventTypes.Sticker, EventTypes.Encrypted]
.contains(event.type)) {
return StateMessage(event); return StateMessage(event);
} }

View file

@ -23,6 +23,7 @@ class MessageContent extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
switch (event.type) { switch (event.type) {
case EventTypes.Message: case EventTypes.Message:
case EventTypes.Encrypted:
case EventTypes.Sticker: case EventTypes.Sticker:
switch (event.messageType) { switch (event.messageType) {
case MessageTypes.Image: case MessageTypes.Image:
@ -134,6 +135,7 @@ class MessageContent extends StatelessWidget {
case MessageTypes.None: case MessageTypes.None:
case MessageTypes.Notice: case MessageTypes.Notice:
case MessageTypes.Emote: case MessageTypes.Emote:
default:
return LinkText( return LinkText(
text: event.getLocalizedBody(context, hideReply: true), text: event.getLocalizedBody(context, hideReply: true),
textStyle: TextStyle( textStyle: TextStyle(
@ -142,12 +144,7 @@ class MessageContent extends StatelessWidget {
), ),
); );
} }
return Text( break;
event.getLocalizedBody(context),
style: TextStyle(
color: textColor,
),
);
default: default:
return Text( return Text(
I18n.of(context).userSentUnknownEvent( I18n.of(context).userSentUnknownEvent(

View file

@ -168,8 +168,6 @@ extension LocalizedBody on Event {
} }
break; break;
case EventTypes.Encrypted: case EventTypes.Encrypted:
localizedBody = I18n.of(context).couldNotDecryptMessage;
break;
case EventTypes.Message: case EventTypes.Message:
switch (this.messageType) { switch (this.messageType) {
case MessageTypes.Image: case MessageTypes.Image:
@ -211,7 +209,10 @@ extension LocalizedBody on Event {
// Hide reply fallback // Hide reply fallback
if (hideReply) { if (hideReply) {
localizedBody = localizedBody.replaceFirst(RegExp(r'^>( \*)? <@[a-zA-Z0-9-.=_\/]+:[^>]+>[^\n]+\r?\n(> [^\n]+\r?\n)*\r?\n'), ""); localizedBody = localizedBody.replaceFirst(
RegExp(
r'^>( \*)? <@[a-zA-Z0-9-.=_\/]+:[^>]+>[^\n]+\r?\n(> [^\n]+\r?\n)*\r?\n'),
"");
} }
// Add the sender name prefix // Add the sender name prefix

View file

@ -124,8 +124,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "6dd3b879b6cfcf1c7da9dedfa62626237afa6d9a" ref: f6379597ed403f340601a27a3ef6b2b971ac1c27
resolved-ref: "6dd3b879b6cfcf1c7da9dedfa62626237afa6d9a" resolved-ref: f6379597ed403f340601a27a3ef6b2b971ac1c27
url: "https://gitlab.com/famedly/famedlysdk.git" url: "https://gitlab.com/famedly/famedlysdk.git"
source: git source: git
version: "0.0.1" version: "0.0.1"

View file

@ -27,7 +27,7 @@ dependencies:
famedlysdk: famedlysdk:
git: git:
url: https://gitlab.com/famedly/famedlysdk.git url: https://gitlab.com/famedly/famedlysdk.git
ref: 5a4c484db62234ac8c782bf03f121e8687a07836 ref: f6379597ed403f340601a27a3ef6b2b971ac1c27
localstorage: ^3.0.1+4 localstorage: ^3.0.1+4
bubble: ^1.1.9+1 bubble: ^1.1.9+1