mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 03:49:04 +03:00
Remove extra space in <mx-reply>
This commit is contained in:
parent
e6c74dc1fe
commit
228ee52563
1 changed files with 24 additions and 23 deletions
|
@ -260,21 +260,19 @@ internal class LocalEchoEventFactory @Inject constructor(private val credentials
|
|||
// </mx-reply>
|
||||
// This is where the reply goes.
|
||||
val body = bodyForReply(eventReplied.getClearContent().toModel<MessageContent>())
|
||||
val replyFallbackTemplateFormatted = """<mx-reply>
|
||||
<blockquote>
|
||||
<a href="%s">${stringProvider.getString(R.string.message_reply_to_prefix)}</a>
|
||||
<a href="%s">%s</a>
|
||||
<br />
|
||||
%s
|
||||
</blockquote>
|
||||
</mx-reply>
|
||||
%s""".trimIndent().format(permalink, userLink, userId, body.second ?: body.first, replyText)
|
||||
val replyFallbackTemplateFormatted = REPLY_PATTERN.format(
|
||||
permalink,
|
||||
stringProvider.getString(R.string.message_reply_to_prefix),
|
||||
userLink,
|
||||
userId,
|
||||
body.second ?: body.first,
|
||||
replyText
|
||||
)
|
||||
//
|
||||
// > <@alice:example.org> This is the original body
|
||||
//
|
||||
// This is where the reply goes
|
||||
val lines = body.first.split("\n")
|
||||
val plainTextBody = StringBuffer("><${userId}>")
|
||||
val plainTextBody = StringBuffer("><$userId>")
|
||||
lines.firstOrNull()?.also { plainTextBody.append(" $it") }
|
||||
lines.forEachIndexed { index, s ->
|
||||
if (index > 0) {
|
||||
|
@ -365,6 +363,9 @@ internal class LocalEchoEventFactory @Inject constructor(private val credentials
|
|||
companion object {
|
||||
const val LOCAL_ID_PREFIX = "local."
|
||||
|
||||
// No whitespace
|
||||
const val REPLY_PATTERN = """<mx-reply><blockquote><a href="%s">%s</a><a href="%s">%s</a><br />%s</blockquote></mx-reply>%s"""
|
||||
|
||||
fun isLocalEchoId(eventId: String): Boolean = eventId.startsWith(LOCAL_ID_PREFIX)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue