Optimize processForwardMessage

This commit is contained in:
Him188 2022-01-28 11:33:54 +00:00
parent 0c708c8197
commit 7251d87621

View File

@ -314,12 +314,9 @@ internal suspend fun <C : Contact> SendMessageHandler<C>.transformSpecialMessage
"ForwardMessage allows up to 200 nodes, but found ${forward.nodeList.size}"
)
}
val tmp = ArrayList<SingleMessage>(
forward.nodeList.sumOf { it.messageChain.size }
)
forward.nodeList.forEach { tmp.addAll(it.messageChain) }
tmp.verifyLength(forward, contact)
sequence {
forward.nodeList.forEach { yieldAll(it.messageChain) }
}.asIterable().verifyLength(forward, contact)
}
val resId = getMiraiImpl().uploadMessageHighway(