improve displayname handling

This commit is contained in:
Henry Hiles 2026-03-01 13:17:26 -05:00
commit 26b8e99a90
No known key found for this signature in database

View file

@ -70,7 +70,9 @@ class MessageController extends AsyncNotifier<Message?> {
"body": newContent?["body"] ?? content["body"], "body": newContent?["body"] ?? content["body"],
"eventType": type, "eventType": type,
"avatarUrl": author?.content["avatar_url"], "avatarUrl": author?.content["avatar_url"],
"displayName": author?.content["displayname"] ?? event.authorId, "displayName": author?.content["displayname"]?.isNotEmpty == true
? author?.content["displayname"]
: event.authorId.substring(1).split(":")[0],
"txnId": config.event.transactionId, "txnId": config.event.transactionId,
}; };