From 4d76aa82b0adbfd829a6631fdeb80070bb8982e6 Mon Sep 17 00:00:00 2001 From: Him188 Date: Mon, 30 Aug 2021 14:06:01 +0800 Subject: [PATCH] Fix FriendAvatarChangedEvent Co-authored-by: Karlatemp --- .../kotlin/network/notice/priv/FriendNoticeProcessor.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mirai-core/src/commonMain/kotlin/network/notice/priv/FriendNoticeProcessor.kt b/mirai-core/src/commonMain/kotlin/network/notice/priv/FriendNoticeProcessor.kt index c31eb102e..1b97351af 100644 --- a/mirai-core/src/commonMain/kotlin/network/notice/priv/FriendNoticeProcessor.kt +++ b/mirai-core/src/commonMain/kotlin/network/notice/priv/FriendNoticeProcessor.kt @@ -226,8 +226,9 @@ internal class FriendNoticeProcessor( private fun NoticePipelineContext.handleAvatarChanged(body: ModCustomFace) { if (body.uin == bot.id) { collect(BotAvatarChangedEvent(bot)) + } else { + collect(FriendAvatarChangedEvent(bot.getFriend(body.uin) ?: return)) } - collect(FriendAvatarChangedEvent(bot.getFriend(body.uin) ?: return)) } private fun NoticePipelineContext.handleFriendDeleted(body: DelFriend) {