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
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);
}

View file

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

View file

@ -168,8 +168,6 @@ extension LocalizedBody on Event {
}
break;
case EventTypes.Encrypted:
localizedBody = I18n.of(context).couldNotDecryptMessage;
break;
case EventTypes.Message:
switch (this.messageType) {
case MessageTypes.Image:
@ -211,7 +209,10 @@ extension LocalizedBody on Event {
// Hide reply fallback
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

View file

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

View file

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