ensuring all rich text usages use asString exit

This commit is contained in:
Adam Brown 2022-10-28 16:24:53 +01:00
parent eeb13b3f6c
commit 45962157f0
1 changed files with 3 additions and 3 deletions

View File

@ -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"
)
}