Decode service message as LongMessageInternal or ForwardMessageInternal if possible

This commit is contained in:
Him188 2021-02-01 13:14:42 +08:00
parent 5857d1b2ee
commit 3ff7fa7db1

View File

@ -558,11 +558,9 @@ internal fun List<ImMsgBody.Elem>.joinToMessageChain(
val resId = this.firstIsInstanceOrNull<ImMsgBody.GeneralFlags>()?.longTextResid
if (resId != null) {
// TODO: 2020/4/29 解析长消息
list.add(SimpleServiceMessage(35, content)) // resId
list.add(LongMessageInternal(content, resId))
} else {
// TODO: 2020/4/29 解析合并转发
list.add(SimpleServiceMessage(35, content))
list.add(ForwardMessageInternal(content))
}
}
@ -655,7 +653,10 @@ internal fun contextualBugReportException(
e: Throwable? = null,
additional: String = ""
): IllegalStateException {
return IllegalStateException("$context 时遇到了意料之中的问题. 请完整复制此日志提交给 mirai: https://github.com/mamoe/mirai/issues/new $additional 调试信息: $forDebug", e)
return IllegalStateException(
"$context 时遇到了意料之中的问题. 请完整复制此日志提交给 mirai: https://github.com/mamoe/mirai/issues/new $additional 调试信息: $forDebug",
e
)
}
@OptIn(ExperimentalContracts::class)