@@ -46,10 +46,25 @@ func DeleteWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model
4646	}
4747}
4848
49+ func  shouldSendCommentChangeNotification (ctx  context.Context , comment  * issues_model.Comment ) bool  {
50+ 	if  err  :=  comment .LoadReview (ctx ); err  !=  nil  {
51+ 		log .Error ("LoadReview: %v" , err )
52+ 		return  false 
53+ 	} else  if  comment .Review  !=  nil  &&  comment .Review .Type  ==  issues_model .ReviewTypePending  {
54+ 		// Pending review comments updating should not triggered 
55+ 		return  false 
56+ 	}
57+ 	return  true 
58+ }
59+ 
4960// CreateIssueComment notifies issue comment related message to notifiers 
5061func  CreateIssueComment (ctx  context.Context , doer  * user_model.User , repo  * repo_model.Repository ,
5162	issue  * issues_model.Issue , comment  * issues_model.Comment , mentions  []* user_model.User ,
5263) {
64+ 	if  ! shouldSendCommentChangeNotification (ctx , comment ) {
65+ 		return 
66+ 	}
67+ 
5368	for  _ , notifier  :=  range  notifiers  {
5469		notifier .CreateIssueComment (ctx , doer , repo , issue , comment , mentions )
5570	}
@@ -156,13 +171,21 @@ func PullReviewDismiss(ctx context.Context, doer *user_model.User, review *issue
156171
157172// UpdateComment notifies update comment to notifiers 
158173func  UpdateComment (ctx  context.Context , doer  * user_model.User , c  * issues_model.Comment , oldContent  string ) {
174+ 	if  ! shouldSendCommentChangeNotification (ctx , c ) {
175+ 		return 
176+ 	}
177+ 
159178	for  _ , notifier  :=  range  notifiers  {
160179		notifier .UpdateComment (ctx , doer , c , oldContent )
161180	}
162181}
163182
164183// DeleteComment notifies delete comment to notifiers 
165184func  DeleteComment (ctx  context.Context , doer  * user_model.User , c  * issues_model.Comment ) {
185+ 	if  ! shouldSendCommentChangeNotification (ctx , c ) {
186+ 		return 
187+ 	}
188+ 
166189	for  _ , notifier  :=  range  notifiers  {
167190		notifier .DeleteComment (ctx , doer , c )
168191	}
0 commit comments