From 85ff0c501a6ae718998c107a75b7601ff33d2231 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Fri, 13 Dec 2024 21:15:38 +0800 Subject: [PATCH] :bug: Bug fixes on notifying user --- pkg/internal/services/events.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/internal/services/events.go b/pkg/internal/services/events.go index 511a0f7..4533bc2 100644 --- a/pkg/internal/services/events.go +++ b/pkg/internal/services/events.go @@ -170,9 +170,10 @@ func NotifyMessageEvent(members []models.ChannelMember, event models.Event) { } } - if len(event.Sender.Nick) == 0 { - user, err := authkit.GetUser(gap.Nx, event.SenderID) - if err == nil { + user, err := authkit.GetUser(gap.Nx, event.SenderID) + if err == nil { + event.Sender.Avatar = user.Avatar + if len(event.Sender.Nick) == 0 { event.Sender.Nick = user.Nick } }