diff --git a/mirai-core-mock/src/contact/MockMsgSyncSupport.kt b/mirai-core-mock/src/contact/MockMsgSyncSupport.kt index 6402e9628..deed11f8c 100644 --- a/mirai-core-mock/src/contact/MockMsgSyncSupport.kt +++ b/mirai-core-mock/src/contact/MockMsgSyncSupport.kt @@ -9,6 +9,7 @@ package net.mamoe.mirai.mock.contact +import net.mamoe.mirai.contact.OtherClient import net.mamoe.mirai.message.data.MessageChain import net.mamoe.mirai.mock.MockBotDSL @@ -17,5 +18,5 @@ public interface MockMsgSyncSupport : MockContact { * 广播消息同步事件 */ @MockBotDSL - public suspend fun broadcastMsgSyncEvent(message: MessageChain, time: Int) + public suspend fun broadcastMsgSyncEvent(client: OtherClient, message: MessageChain, time: Int) } \ No newline at end of file diff --git a/mirai-core-mock/src/internal/contact/MockFriendImpl.kt b/mirai-core-mock/src/internal/contact/MockFriendImpl.kt index 643cd9e4e..1d51ed533 100644 --- a/mirai-core-mock/src/internal/contact/MockFriendImpl.kt +++ b/mirai-core-mock/src/internal/contact/MockFriendImpl.kt @@ -14,6 +14,7 @@ package net.mamoe.mirai.mock.internal.contact import kotlinx.coroutines.cancel import net.mamoe.mirai.contact.AvatarSpec import net.mamoe.mirai.contact.Friend +import net.mamoe.mirai.contact.OtherClient import net.mamoe.mirai.contact.friendgroup.FriendGroup import net.mamoe.mirai.contact.roaming.RoamingMessages import net.mamoe.mirai.event.broadcast @@ -130,12 +131,12 @@ internal class MockFriendImpl( return msg } - override suspend fun broadcastMsgSyncEvent(message: MessageChain, time: Int) { + override suspend fun broadcastMsgSyncEvent(client: OtherClient, message: MessageChain, time: Int) { val src = newMsgSrc(true, message, time.toLong()) { ids, internalIds, time0 -> OnlineMsgSrcToFriend(ids, internalIds, time0, message, bot, bot, this) } val msg = src.withMessage(message) - FriendMessageSyncEvent(this, msg, time).broadcast() + FriendMessageSyncEvent(client, this, msg, time).broadcast() } override fun toString(): String { diff --git a/mirai-core-mock/src/internal/contact/MockGroupImpl.kt b/mirai-core-mock/src/internal/contact/MockGroupImpl.kt index a1f1a800a..60649cebb 100644 --- a/mirai-core-mock/src/internal/contact/MockGroupImpl.kt +++ b/mirai-core-mock/src/internal/contact/MockGroupImpl.kt @@ -317,19 +317,19 @@ internal class MockGroupImpl( } } - override suspend fun broadcastMsgSyncEvent(message: MessageChain, time: Int) { + override suspend fun broadcastMsgSyncEvent(client: OtherClient, message: MessageChain, time: Int) { val src = newMsgSrc(true, message, time.toLong()) { ids, internalIds, time0 -> OnlineMsgSrcToGroup(ids, internalIds, time0, message, bot, bot, this) } val msg = src.withMessage(message) - GroupMessageSyncEvent(this, msg, botAsMember, bot.nick, time).broadcast() + GroupMessageSyncEvent(client, this, msg, botAsMember, bot.nick, time).broadcast() } override suspend fun sendMessage(message: Message): MessageReceipt { return super.sendMessage(message).cast() } - @Suppress("OverridingDeprecatedMember", "DEPRECATION", "DEPRECATION_ERROR", "OVERRIDE_DEPRECATION") + @Suppress("OverridingDeprecatedMember", "DEPRECATION_ERROR", "OVERRIDE_DEPRECATION") override suspend fun uploadVoice(resource: ExternalResource): net.mamoe.mirai.message.data.Voice = resource.mockUploadVoice(bot)