Skip to content

Commit

Permalink
fix(comment): do not send notification when reply myself
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkinStars committed Jan 30, 2023
1 parent 782eb7a commit 00e4f2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/service/comment/comment_service.go
Expand Up @@ -138,7 +138,7 @@ func (cs *CommentService) AddComment(ctx context.Context, req *schema.AddComment
time.Now(), req.CanEdit, req.CanDelete)

// get reply user info
if len(resp.ReplyUserID) > 0 {
if len(resp.ReplyUserID) > 0 && resp.ReplyUserID != req.UserID {
replyUser, exist, err := cs.userCommon.GetUserBasicInfoByID(ctx, resp.ReplyUserID)
if err != nil {
return nil, err
Expand All @@ -148,7 +148,7 @@ func (cs *CommentService) AddComment(ctx context.Context, req *schema.AddComment
resp.ReplyUserDisplayName = replyUser.DisplayName
resp.ReplyUserStatus = replyUser.Status
}
cs.notificationCommentReply(ctx, replyUser.ID, objInfo.QuestionID, req.UserID)
cs.notificationCommentReply(ctx, replyUser.ID, comment.ID, req.UserID)
}

// get user info
Expand Down

0 comments on commit 00e4f2c

Please sign in to comment.