Remove flutter chat #26

Manually merged
Henry-Hiles merged 108 commits from remove-flutter-chat into main 2026-05-22 15:26:28 -04:00
2 changed files with 14 additions and 9 deletions
Showing only changes of commit fc6ca5b454 - Show all commits

Make message format an enum

Henry Hiles 2026-05-20 10:38:10 -04:00
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -15,28 +15,28 @@ abstract class MessageContent extends Content with _$MessageContent {
@FreezedUnionValue("m.text")
factory MessageContent.text({
required String body,
String? format,
MessageFormat? format,
String? formattedBody,
}) = TextMessageContent;
@FreezedUnionValue("m.notice")
factory MessageContent.notice({
required String body,
String? format,
MessageFormat? format,
String? formattedBody,
}) = NoticeMessageContent;
@FreezedUnionValue("m.emote")
factory MessageContent.emote({
required String body,
String? format,
MessageFormat? format,
String? formattedBody,
}) = EmoteMessageContent;
@FreezedUnionValue("m.image")
factory MessageContent.image({
required String body,
String? format,
MessageFormat? format,
String? formattedBody,
// EncryptedFile? file
String? filename,
@ -47,7 +47,7 @@ abstract class MessageContent extends Content with _$MessageContent {
@FreezedUnionValue("m.file")
factory MessageContent.file({
required String body,
String? format,
MessageFormat? format,
String? formattedBody,
// EncryptedFile? file
String? filename,
@ -58,7 +58,7 @@ abstract class MessageContent extends Content with _$MessageContent {
@FreezedUnionValue("m.audio")
factory MessageContent.audio({
required String body,
String? format,
MessageFormat? format,
String? formattedBody,
// EncryptedFile? file
String? filename,
@ -69,7 +69,7 @@ abstract class MessageContent extends Content with _$MessageContent {
@FreezedUnionValue("m.video")
factory MessageContent.video({
required String body,
String? format,
MessageFormat? format,
String? formattedBody,
// EncryptedFile? file
String? filename,
@ -84,3 +84,9 @@ abstract class MessageContent extends Content with _$MessageContent {
factory MessageContent.fromJson(Map<String, Object?> json) =>
_$MessageContentFromJson(json);
}
@JsonEnum()
enum MessageFormat {
@JsonValue("org.matrix.custom.html")
html,
}

View file

@ -231,8 +231,7 @@ class EventRenderer extends ConsumerWidget {
) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
format == "org.matrix.custom.html" &&
!textOnly
format == MessageFormat.html && !textOnly
? Html(
textStyle: textStyle,
formattedBody!.replaceAllMapped(