From a2272cab0698c2cc07f9a77f41b00b52cac1c188 Mon Sep 17 00:00:00 2001 From: hawklin2017 <32898629+hawklin2017@users.noreply.github.com> Date: Sun, 26 Apr 2026 21:36:37 +0800 Subject: [PATCH] add friend --- internal/rpc/relation/friend.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/internal/rpc/relation/friend.go b/internal/rpc/relation/friend.go index 81286ac28..c1eeee386 100644 --- a/internal/rpc/relation/friend.go +++ b/internal/rpc/relation/friend.go @@ -696,12 +696,15 @@ func (s *friendServer) AddOnewayFriend(ctx context.Context, req *relation.ApplyT if err := s.db.BecomeOnewayFriend(ctx, req.FromUserID, req.ToUserID, becomeFriendByOneway); err != nil { return nil, err } - // Notify only A so that A's incremental friend sync is triggered. - s.notificationSender.FriendApplicationAgreedNotification(ctx, &relation.RespondFriendApplyReq{ - FromUserID: req.FromUserID, - ToUserID: req.ToUserID, - HandleResult: constant.FriendResponseAgree, - }, false) + // Notify only A (FromUserID) so incremental friend sync is triggered + // without notifying B (ToUserID). + tips := sdkws.FriendApplicationApprovedTips{ + FromToUserID: &sdkws.FromToUserID{ + FromUserID: req.FromUserID, + ToUserID: req.ToUserID, + }, + } + s.notificationSender.Notification(ctx, req.FromUserID, req.FromUserID, constant.FriendApplicationApprovedNotification, &tips) return &relation.ApplyToAddFriendResp{}, nil }