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 24963915b9
commit 266612f9da
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"),