fix null edit source

This commit is contained in:
Henry Hiles 2026-03-01 14:53:24 -05:00
commit 77b81948b0
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View file

@ -68,7 +68,10 @@ class MessageController extends AsyncNotifier<Message?> {
"body": newContent?["body"] ?? content["body"],
"eventType": type,
"avatarUrl": author?.content["avatar_url"],
"editSource": event.localContent?.editSource,
"editSource":
event.localContent?.editSource ??
newContent?["body"] ??
content["body"],
"displayName": author?.content["displayname"]?.isNotEmpty == true
? author?.content["displayname"]
: event.authorId.substring(1).split(":")[0],

View file

@ -34,7 +34,7 @@ class ChatBox extends HookConsumerWidget {
if (relationType == RelationType.edit &&
relatedMessage is TextMessage &&
controller.value.text.isEmpty) {
controller.value.text = relatedMessage?.metadata?["editSource"];
controller.value.text = relatedMessage?.metadata?["editSource"] ?? "";
}
void send() {