mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-06-27 13:03:54 +08:00
add friend
This commit is contained in:
parent
f0e41367c1
commit
a2272cab06
@ -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
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user