fix wrapping of previews of unknown message types

This commit is contained in:
Henry Hiles 2026-11-19 20:13:28 -05:00
commit 54f2c93d92
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -143,13 +143,19 @@ class const MessageRenderer(
UnknownMessageContent(:final body) => UnknownMessageContent(:final body) =>
body == null body == null
? Text("This message is redacted", style: errorStyle) ? Text("This message is redacted", style: errorStyle)
: Wrap( : Text.rich(
spacing: 8, TextSpan(
children: [ children: [
Text("Unknown message type:", style: errorStyle), TextSpan(
Text(body), text: "Unknown message type: ",
style: errorStyle,
),
TextSpan(text: body),
], ],
), ),
maxLines: maxLines,
overflow: maxLines == null ? null : .ellipsis,
),
}, },
_ => throw Exception("This is impossible"), _ => throw Exception("This is impossible"),
}; };