diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt index b0fca12a0..8f6ef51cc 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt @@ -411,7 +411,7 @@ internal object Transformers528 : Map by mapOf( return this.msgFrdRmk?.asSequence()?.mapNotNull { val friend = bot.getFriendOrNull(it.fuin) ?: return@mapNotNull null // TODO: 2020/4/10 ADD REMARK QUERY - FriendRemarkChangeEvent(bot, friend, it.rmkName) + FriendRemarkChangeEvent(friend, it.rmkName) } ?: emptySequence() } @@ -519,7 +519,7 @@ internal object Transformers528 : Map by mapOf( return sequenceOf(BotAvatarChangedEvent(bot)) } val friend = bot.getFriendOrNull(uin) ?: return emptySequence() - return sequenceOf(FriendFaceChangedEvent(friend)) + return sequenceOf(FriendAvatarChangedEvent(friend)) } diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt index 9fea92a40..d782f4c24 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt @@ -83,7 +83,7 @@ sealed class BotOfflineEvent : BotEvent, AbstractEvent() { } /** - * [Bot] 主动或被动重新登录. + * [Bot] 主动或被动重新登录. 在此事件广播前就已经登录完毕. */ data class BotReloginEvent internal constructor( override val bot: Bot, @@ -91,14 +91,14 @@ data class BotReloginEvent internal constructor( ) : BotEvent, BotActiveEvent, AbstractEvent() /** - * [Bot] 头像被修改(通过其他客户端修改了Bot的头像) + * [Bot] 头像被修改(通过其他客户端修改了头像). 在此事件广播前就已经修改完毕. */ data class BotAvatarChangedEvent( override val bot: Bot ) : BotEvent, Packet, AbstractEvent() /** - * [Friend] 头像被修改 + * [Friend] 头像被修改. 在此事件广播前就已经修改完毕. */ data class FriendAvatarChangedEvent( override val friend: Friend @@ -658,7 +658,6 @@ data class MemberUnmuteEvent( * 好友昵称改变事件. 目前仅支持解析 (来自 PC 端的修改). */ data class FriendRemarkChangeEvent( - override val bot: Bot, override val friend: Friend, val newName: String ) : FriendEvent, Packet, AbstractEvent() @@ -671,18 +670,14 @@ data class FriendAddEvent( * 新好友. 已经添加到 [Bot.friends] */ override val friend: Friend -) : FriendEvent, Packet, AbstractEvent() { - override val bot: Bot get() = friend.bot -} +) : FriendEvent, Packet, AbstractEvent() /** * 好友已被删除的事件. */ data class FriendDeleteEvent( override val friend: Friend -) : FriendEvent, Packet, AbstractEvent() { - override val bot: Bot get() = friend.bot -} +) : FriendEvent, Packet, AbstractEvent() /** * 一个账号请求添加机器人为好友的事件 diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/types.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/types.kt index 04029aa56..bb1057456 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/types.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/types.kt @@ -7,6 +7,8 @@ * https://github.com/mamoe/mirai/blob/master/LICENSE */ +@file:Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") + package net.mamoe.mirai.event.events import net.mamoe.mirai.Bot @@ -84,6 +86,5 @@ val GroupOperableEvent.operatorOrBot: Member */ interface FriendEvent : BotEvent { val friend: Friend - override val bot: Bot - get() = friend.bot + final override val bot: Bot get() = friend.bot } \ No newline at end of file