Fix reply fallback prefix

Plain text reply fallback should be prefixed with "> " not ">" (as per spec).

Signed-off-by: Stuart Mumford <stuart@cadair.com>
This commit is contained in:
Stuart Mumford 2019-07-22 17:21:55 +01:00
parent 6d01a570fd
commit 90fad23493
No known key found for this signature in database
GPG Key ID: 60BC5C03E6276769

View File

@ -306,12 +306,12 @@ internal class LocalEchoEventFactory @Inject constructor(private val credentials

private fun buildReplyFallback(body: TextContent, originalSenderId: String?, newBodyText: String): String {
val lines = body.text.split("\n")
val replyFallback = StringBuffer("><$originalSenderId>")
val replyFallback = StringBuffer("> <$originalSenderId>")
lines.forEachIndexed { index, s ->
if (index == 0) {
replyFallback.append(" $s")
} else {
replyFallback.append("\n>$s")
replyFallback.append("\n> $s")
}
}
replyFallback.append("\n\n").append(newBodyText)