From 45962157f0265d6f7ad04d18cd186102098ac525 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 28 Oct 2022 16:24:53 +0100 Subject: [PATCH] ensuring all rich text usages use asString exit --- .../dapk/st/matrix/message/internal/SendMessageUseCase.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matrix/services/message/src/main/kotlin/app/dapk/st/matrix/message/internal/SendMessageUseCase.kt b/matrix/services/message/src/main/kotlin/app/dapk/st/matrix/message/internal/SendMessageUseCase.kt index 1f30366..f070232 100644 --- a/matrix/services/message/src/main/kotlin/app/dapk/st/matrix/message/internal/SendMessageUseCase.kt +++ b/matrix/services/message/src/main/kotlin/app/dapk/st/matrix/message/internal/SendMessageUseCase.kt @@ -153,13 +153,13 @@ class ApiMessageMapper { fun Message.TextMessage.toContents(reply: Message.TextMessage.Reply?) = when (reply) { null -> ApiMessage.TextMessage.TextContent( - body = this.content.body.parts.joinToString(""), + body = this.content.body.asString(), ) else -> ApiMessage.TextMessage.TextContent( - body = buildReplyFallback(reply.originalMessage.parts.joinToString(""), reply.author.id, reply.replyContent), + body = buildReplyFallback(reply.originalMessage.asString(), reply.author.id, reply.replyContent), relatesTo = ApiMessage.RelatesTo(ApiMessage.RelatesTo.InReplyTo(reply.eventId)), - formattedBody = buildFormattedReply(reply.author.id, reply.originalMessage.parts.joinToString(""), reply.replyContent, this.roomId, reply.eventId), + formattedBody = buildFormattedReply(reply.author.id, reply.originalMessage.asString(), reply.replyContent, this.roomId, reply.eventId), format = "org.matrix.custom.html" ) }