diff --git a/internal/rpc/relation/friend.go b/internal/rpc/relation/friend.go index c1eeee386..ef44566f2 100644 --- a/internal/rpc/relation/friend.go +++ b/internal/rpc/relation/friend.go @@ -693,7 +693,7 @@ func (s *friendServer) AddOnewayFriend(ctx context.Context, req *relation.ApplyT if in1 { return nil, servererrs.ErrRelationshipAlready.WrapMsg("already in friend list") } - if err := s.db.BecomeOnewayFriend(ctx, req.FromUserID, req.ToUserID, becomeFriendByOneway); err != nil { + if err := s.db.BecomeOnewayFriend(ctx, req.FromUserID, req.ToUserID, becomeFriendByOneway, req.Remark); err != nil { return nil, err } // Notify only A (FromUserID) so incremental friend sync is triggered diff --git a/pkg/common/storage/controller/friend.go b/pkg/common/storage/controller/friend.go index 65ca90186..f863f596b 100644 --- a/pkg/common/storage/controller/friend.go +++ b/pkg/common/storage/controller/friend.go @@ -95,7 +95,7 @@ type FriendDatabase interface { // BecomeOnewayFriend inserts a single-side friendship: ownerUserID -> friendUserID. // The reverse side (friendUserID -> ownerUserID) is NOT created. - BecomeOnewayFriend(ctx context.Context, ownerUserID, friendUserID string, addSource int32) error + BecomeOnewayFriend(ctx context.Context, ownerUserID, friendUserID string, addSource int32, remark string) error } type friendDatabase struct { @@ -415,7 +415,7 @@ func (f *friendDatabase) GetPinnedFriendIDs(ctx context.Context, ownerUserID str // BecomeOnewayFriend creates only the ownerUserID->friendUserID side of the friendship. // The reverse side is intentionally omitted so that the target user is not aware of being added. -func (f *friendDatabase) BecomeOnewayFriend(ctx context.Context, ownerUserID, friendUserID string, addSource int32) error { +func (f *friendDatabase) BecomeOnewayFriend(ctx context.Context, ownerUserID, friendUserID string, addSource int32, remark string) error { return f.tx.Transaction(ctx, func(ctx context.Context) error { existing, err := f.friend.FindFriends(ctx, ownerUserID, []string{friendUserID}) if err != nil { @@ -427,7 +427,7 @@ func (f *friendDatabase) BecomeOnewayFriend(ctx context.Context, ownerUserID, fr } opUserID := mcontext.GetOpUserID(ctx) if err := f.friend.Create(ctx, []*model.Friend{ - {OwnerUserID: ownerUserID, FriendUserID: friendUserID, AddSource: addSource, OperatorUserID: opUserID}, + {OwnerUserID: ownerUserID, FriendUserID: friendUserID, AddSource: addSource, OperatorUserID: opUserID, Remark: remark}, }); err != nil { return err } diff --git a/protocol b/protocol index ba5857cc0..7f613eb71 160000 --- a/protocol +++ b/protocol @@ -1 +1 @@ -Subproject commit ba5857cc0817dcfaf6892af0c542385b71f46377 +Subproject commit 7f613eb71f23a69730cfb3c3abd1515da0fb17cf