From 7e7f17ac27f889491bfc3f47b19c9d935d9e56cf Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Sat, 29 Oct 2022 14:03:27 +0100 Subject: [PATCH] use asString helper when convering rich text to a string message --- .../src/main/kotlin/app/dapk/st/engine/DirectoryUseCase.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/matrix-chat-engine/src/main/kotlin/app/dapk/st/engine/DirectoryUseCase.kt b/matrix-chat-engine/src/main/kotlin/app/dapk/st/engine/DirectoryUseCase.kt index 897d026..fc876fd 100644 --- a/matrix-chat-engine/src/main/kotlin/app/dapk/st/engine/DirectoryUseCase.kt +++ b/matrix-chat-engine/src/main/kotlin/app/dapk/st/engine/DirectoryUseCase.kt @@ -1,9 +1,6 @@ package app.dapk.st.engine -import app.dapk.st.matrix.common.CredentialsStore -import app.dapk.st.matrix.common.RoomId -import app.dapk.st.matrix.common.RoomMember -import app.dapk.st.matrix.common.UserId +import app.dapk.st.matrix.common.* import app.dapk.st.matrix.message.MessageService import app.dapk.st.matrix.room.RoomService import app.dapk.st.matrix.sync.RoomStore @@ -68,7 +65,7 @@ internal class DirectoryUseCase( this.copy( lastMessage = RoomOverview.LastMessage( content = when (val message = latestEcho.message) { - is MessageService.Message.TextMessage -> message.content.body.parts.joinToString("") + is MessageService.Message.TextMessage -> message.content.body.asString() is MessageService.Message.ImageMessage -> "\uD83D\uDCF7" }, utcTimestamp = latestEcho.timestampUtc,