THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

sub-comment: Change notification coverage

If parent comment author write a addtional subcomment,
all sub-comment authors will receive notification.
tags/v1.11.0
Suwon Chae 1 year ago
parent
commit
39e1b486e4
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      app/models/NotificationEvent.java

+ 9
- 1
app/models/NotificationEvent.java View File

@@ -1050,10 +1050,18 @@ public class NotificationEvent extends Model implements INotificationEvent {
receivers.add(parent.getAuthor());
receivers.addAll(getMentionedUsers(comment.contents));
includeAssigneeIfExist(comment, receivers);
if (comment.getParentComment() != null) {
Comment parentComment = comment.getParentComment();
if (parentComment != null) {
receivers.remove(User.find.byId(comment.getParent().authorId));
receivers.add(User.find.byId(comment.getParentComment().authorId));

if (parentComment.authorId.equals(comment.authorId)) { // when parent comment author is writing sub-comment
for(Comment subComment: comment.getSiblingComments()) {
receivers.add(User.find.byId(subComment.authorId));
}
}
}

receivers.addAll(findEventWatchersByEventType(comment.projectId, eventType));

receivers.removeAll(findUnwatchers(parent.asResource()));


Loading…
Cancel
Save