ensuring all rich text usages use asString exit
This commit is contained in:
parent
eeb13b3f6c
commit
45962157f0
|
@ -153,13 +153,13 @@ class ApiMessageMapper {
|
||||||
|
|
||||||
fun Message.TextMessage.toContents(reply: Message.TextMessage.Reply?) = when (reply) {
|
fun Message.TextMessage.toContents(reply: Message.TextMessage.Reply?) = when (reply) {
|
||||||
null -> ApiMessage.TextMessage.TextContent(
|
null -> ApiMessage.TextMessage.TextContent(
|
||||||
body = this.content.body.parts.joinToString(""),
|
body = this.content.body.asString(),
|
||||||
)
|
)
|
||||||
|
|
||||||
else -> ApiMessage.TextMessage.TextContent(
|
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)),
|
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"
|
format = "org.matrix.custom.html"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue