add edits

This commit is contained in:
Henry Hiles 2025-11-23 16:56:42 -05:00
commit 6523420120
No known key found for this signature in database
3 changed files with 47 additions and 15 deletions

View file

@ -136,13 +136,16 @@ class RoomChat extends HookConsumerWidget {
}) => FlyerChatTextMessage(
customWidget: HtmlWidget(
message.metadata?["formatted"].replaceAllMapped(
RegExp(
r'(?<!href="|">)(https?:\/\/[^\s<]+)',
caseSensitive: false,
),
(m) =>
"<a href=\"${m.group(0)!}\">${m.group(0)!}</a>",
),
RegExp(
r'(?<!href="|">)(https?:\/\/[^\s<]+)',
caseSensitive: false,
),
(m) =>
"<a href=\"${m.group(0)!}\">${m.group(0)!}</a>",
) +
((message.editedAt != null)
? "<sub edited>(edited)</sub>"
: ""),
customWidgetBuilder: (element) {
if (element.localName == "mx-reply") {
return SizedBox.shrink();
@ -193,11 +196,17 @@ class RoomChat extends HookConsumerWidget {
"color",
value,
),
"data-mx-bg-color" =>
MapEntry(
"background-color",
value,
),
"edited" => MapEntry(
"display",
"block",
),
_ => null,
},
)