MessageContent.type cannot be null

This commit is contained in:
Benoit Marty 2023-10-11 16:12:20 +02:00 committed by Benoit Marty
parent 1b0e044565
commit 8c2a5f281b
3 changed files with 3 additions and 5 deletions

View file

@ -49,7 +49,7 @@ class TimelineItemContentMessageFactory @Inject constructor(
) {
fun create(content: MessageContent, senderDisplayName: String): TimelineItemEventContent {
return when (val messageType = content.type ?: UnknownMessageType) {
return when (val messageType = content.type) {
is EmoteMessageType -> TimelineItemEmoteContent(
body = "* $senderDisplayName ${messageType.body}",
htmlDocument = messageType.formatted?.toHtmlDocument(prefix = "* senderDisplayName"),