mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-09 18:26:58 +08:00
Decode service message as LongMessageInternal or ForwardMessageInternal if possible
This commit is contained in:
parent
5857d1b2ee
commit
3ff7fa7db1
@ -558,11 +558,9 @@ internal fun List<ImMsgBody.Elem>.joinToMessageChain(
|
|||||||
val resId = this.firstIsInstanceOrNull<ImMsgBody.GeneralFlags>()?.longTextResid
|
val resId = this.firstIsInstanceOrNull<ImMsgBody.GeneralFlags>()?.longTextResid
|
||||||
|
|
||||||
if (resId != null) {
|
if (resId != null) {
|
||||||
// TODO: 2020/4/29 解析长消息
|
list.add(LongMessageInternal(content, resId))
|
||||||
list.add(SimpleServiceMessage(35, content)) // resId
|
|
||||||
} else {
|
} else {
|
||||||
// TODO: 2020/4/29 解析合并转发
|
list.add(ForwardMessageInternal(content))
|
||||||
list.add(SimpleServiceMessage(35, content))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -655,7 +653,10 @@ internal fun contextualBugReportException(
|
|||||||
e: Throwable? = null,
|
e: Throwable? = null,
|
||||||
additional: String = ""
|
additional: String = ""
|
||||||
): IllegalStateException {
|
): 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)
|
@OptIn(ExperimentalContracts::class)
|
||||||
|
Loading…
Reference in New Issue
Block a user