diff --git a/mirai-core/src/commonMain/kotlin/message/incomingSourceImpl.kt b/mirai-core/src/commonMain/kotlin/message/incomingSourceImpl.kt index 5ca0011d2..d3f1c6486 100644 --- a/mirai-core/src/commonMain/kotlin/message/incomingSourceImpl.kt +++ b/mirai-core/src/commonMain/kotlin/message/incomingSourceImpl.kt @@ -49,25 +49,15 @@ internal interface MessageSourceInternal { } @Suppress("RedundantSuspendModifier", "unused") -internal suspend inline fun MessageSource.ensureSequenceIdAvailable() { - // obsolete but keep for future - return - /* - if (this is MessageSourceToGroupImpl) { - this.ensureSequenceIdAvailable() - }*/ +internal suspend fun MessageSource.ensureSequenceIdAvailable() { + if (this is OnlineMessageSourceToGroupImpl) { + ensureSequenceIdAvailable() + } } @Suppress("RedundantSuspendModifier", "unused") internal suspend inline fun Message.ensureSequenceIdAvailable() { - // no suspend. - - // obsolete but keep for future - return - /* - if (this is MessageSourceToGroupImpl) { - this.ensureSequenceIdAvailable() - }*/ + (this as? MessageChain)?.sourceOrNull?.ensureSequenceIdAvailable() } @Serializable(OnlineMessageSourceFromFriendImpl.Serializer::class)