Try fix forward message display (#1052)

fix https://github.com/mamoe/mirai/issues/1052#issuecomment-805600071
This commit is contained in:
Karlatemp 2021-03-24 23:59:38 +08:00
parent c071ac5773
commit a5e85f443e
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8

View File

@ -208,7 +208,7 @@ internal fun RichMessage.Key.longMessage(brief: String, resId: String, timeSecon
</item>
<source name="聊天记录" icon="" action="" appid="-1"/>
</msg>
""".trimIndent()
""".trimIndent().trim()
return LongMessageInternal(template, resId)
}
@ -220,7 +220,7 @@ internal fun RichMessage.Key.forwardMessage(
forwardMessage: ForwardMessage,
): ForwardMessageInternal = with(forwardMessage) {
val template = """
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<?xml version="1.0" encoding="utf-8"?>
<msg serviceID="35" templateID="1" action="viewMultiMsg" brief="${brief.take(30)}"
m_resid="$resId" m_fileName="$timeSeconds"
tSum="3" sourceMsgId="0" url="" flag="3" adverSign="0" multiMsgFlag="0">
@ -245,6 +245,6 @@ internal fun RichMessage.Key.forwardMessage(
</item>
<source name="${source.take(50)}" icon="" action="" appid="-1"/>
</msg>
""".trimIndent().replace("\n", " ")
""".trimIndent().replace("\n", " ").trim()
return ForwardMessageInternal(template, resId)
}