mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-20 15:49:15 +08:00
Fix BotFaceChangedEvent
, Add FriendFaceChangedEvent
This commit is contained in:
parent
6db2c23a17
commit
d16a699810
@ -493,8 +493,13 @@ private object Transformers528 : Map<Long, MsgType0x210.(QQAndroidBot) -> Sequen
|
||||
} ?: emptySequence()
|
||||
}
|
||||
|
||||
fun ModCustomFace.transform(): Sequence<Packet> =
|
||||
sequenceOf(BotFaceChangedEvent(Bot.getInstance(uin)))
|
||||
fun ModCustomFace.transform(bot: QQAndroidBot): Sequence<Packet> {
|
||||
if (uin == bot.id) {
|
||||
return sequenceOf(BotFaceChangedEvent(bot))
|
||||
}
|
||||
val friend = bot.getFriendOrNull(uin) ?: return emptySequence()
|
||||
return sequenceOf(FriendFaceChangedEvent(friend))
|
||||
}
|
||||
|
||||
|
||||
return@lambda528 vProtobuf.loadAs(SubMsgType0x27MsgBody.serializer()).msgModInfos.asSequence()
|
||||
@ -504,7 +509,7 @@ private object Transformers528 : Map<Long, MsgType0x210.(QQAndroidBot) -> Sequen
|
||||
it.msgDelFriend != null -> it.msgDelFriend.transform(bot)
|
||||
it.msgModGroupProfile != null -> it.msgModGroupProfile.transform(bot)
|
||||
it.msgModGroupMemberProfile != null -> it.msgModGroupMemberProfile.transform(bot)
|
||||
it.msgModCustomFace != null -> it.msgModCustomFace.transform()
|
||||
it.msgModCustomFace != null -> it.msgModCustomFace.transform(bot)
|
||||
else -> {
|
||||
bot.network.logger.debug {
|
||||
"Transformers528 0x27L: new data: ${it._miraiContentToString()}"
|
||||
|
@ -95,6 +95,13 @@ data class BotFaceChangedEvent(
|
||||
override val bot: Bot
|
||||
) : BotEvent, Packet, AbstractEvent()
|
||||
|
||||
/**
|
||||
* [Friend] 头像被修改
|
||||
*/
|
||||
data class FriendFaceChangedEvent(
|
||||
override val friend: Friend
|
||||
) : FriendEvent, Packet, AbstractEvent()
|
||||
|
||||
// endregion
|
||||
|
||||
// region 消息
|
||||
|
Loading…
Reference in New Issue
Block a user