mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-06-18 17:09:17 +08:00
fix: import friends send notification (#3420)
This commit is contained in:
parent
d156e1e519
commit
545125884e
@ -192,7 +192,7 @@ func (s *friendServer) ImportFriends(ctx context.Context, req *relation.ImportFr
|
|||||||
FromUserID: req.OwnerUserID,
|
FromUserID: req.OwnerUserID,
|
||||||
ToUserID: userID,
|
ToUserID: userID,
|
||||||
HandleResult: constant.FriendResponseAgree,
|
HandleResult: constant.FriendResponseAgree,
|
||||||
})
|
}, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.webhookAfterImportFriends(ctx, &s.config.WebhooksConfig.AfterImportFriends, req)
|
s.webhookAfterImportFriends(ctx, &s.config.WebhooksConfig.AfterImportFriends, req)
|
||||||
@ -221,7 +221,7 @@ func (s *friendServer) RespondFriendApply(ctx context.Context, req *relation.Res
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
s.webhookAfterAddFriendAgree(ctx, &s.config.WebhooksConfig.AfterAddFriendAgree, req)
|
s.webhookAfterAddFriendAgree(ctx, &s.config.WebhooksConfig.AfterAddFriendAgree, req)
|
||||||
s.notificationSender.FriendApplicationAgreedNotification(ctx, req)
|
s.notificationSender.FriendApplicationAgreedNotification(ctx, req, true)
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
if req.HandleResult == constant.FriendResponseRefuse {
|
if req.HandleResult == constant.FriendResponseRefuse {
|
||||||
|
@ -171,11 +171,17 @@ func (f *FriendNotificationSender) FriendApplicationAddNotification(ctx context.
|
|||||||
f.Notification(ctx, req.FromUserID, req.ToUserID, constant.FriendApplicationNotification, &tips)
|
f.Notification(ctx, req.FromUserID, req.ToUserID, constant.FriendApplicationNotification, &tips)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FriendNotificationSender) FriendApplicationAgreedNotification(ctx context.Context, req *relation.RespondFriendApplyReq) {
|
func (f *FriendNotificationSender) FriendApplicationAgreedNotification(ctx context.Context, req *relation.RespondFriendApplyReq, checkReq bool) {
|
||||||
request, err := f.getFriendRequests(ctx, req.FromUserID, req.ToUserID)
|
var (
|
||||||
if err != nil {
|
request *sdkws.FriendRequest
|
||||||
log.ZError(ctx, "FriendApplicationAgreedNotification get friend request", err, "fromUserID", req.FromUserID, "toUserID", req.ToUserID)
|
err error
|
||||||
return
|
)
|
||||||
|
if checkReq {
|
||||||
|
request, err = f.getFriendRequests(ctx, req.FromUserID, req.ToUserID)
|
||||||
|
if err != nil {
|
||||||
|
log.ZError(ctx, "FriendApplicationAgreedNotification get friend request", err, "fromUserID", req.FromUserID, "toUserID", req.ToUserID)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tips := sdkws.FriendApplicationApprovedTips{
|
tips := sdkws.FriendApplicationApprovedTips{
|
||||||
FromToUserID: &sdkws.FromToUserID{
|
FromToUserID: &sdkws.FromToUserID{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user