forked from GitHub-Mirror/riotX-android
Fix actually done TODO
This commit is contained in:
parent
1918302297
commit
e5082f662c
@ -98,24 +98,27 @@ internal class LocalEchoEventFactory @Inject constructor(private val credentials
|
||||
newBodyAutoMarkdown: Boolean,
|
||||
msgType: String,
|
||||
compatibilityText: String): Event {
|
||||
// TODO Format newBodyText
|
||||
var newContent = MessageTextContent(
|
||||
type = MessageType.MSGTYPE_TEXT,
|
||||
body = newBodyText
|
||||
)
|
||||
if (newBodyAutoMarkdown) {
|
||||
val parser = Parser.builder().build()
|
||||
val newContent = if (newBodyAutoMarkdown) {
|
||||
val document = parser.parse(newBodyText)
|
||||
val renderer = HtmlRenderer.builder().build()
|
||||
val htmlText = renderer.render(document)
|
||||
if (isFormattedTextPertinent(newBodyText, htmlText)) {
|
||||
newContent = MessageTextContent(
|
||||
MessageTextContent(
|
||||
type = MessageType.MSGTYPE_TEXT,
|
||||
format = MessageType.FORMAT_MATRIX_HTML,
|
||||
body = newBodyText,
|
||||
formattedBody = htmlText
|
||||
)
|
||||
} else {
|
||||
MessageTextContent(
|
||||
type = MessageType.MSGTYPE_TEXT,
|
||||
body = newBodyText
|
||||
)
|
||||
}
|
||||
} else {
|
||||
MessageTextContent(
|
||||
type = MessageType.MSGTYPE_TEXT,
|
||||
body = newBodyText
|
||||
)
|
||||
}
|
||||
|
||||
val content = MessageTextContent(
|
||||
|
Loading…
Reference in New Issue
Block a user