[Notice] Announcing the End of Demo Server [Read me]
sub-comment: Change notification coverage
If parent comment author write a addtional subcomment, all sub-comment authors will receive notification.
@39e1b486e4b080f2e50f61990c53c5871ca347e6
--- app/models/NotificationEvent.java
+++ app/models/NotificationEvent.java
... | ... | @@ -1050,10 +1050,18 @@ |
1050 | 1050 |
receivers.add(parent.getAuthor()); |
1051 | 1051 |
receivers.addAll(getMentionedUsers(comment.contents)); |
1052 | 1052 |
includeAssigneeIfExist(comment, receivers); |
1053 |
- if (comment.getParentComment() != null) { |
|
1053 |
+ Comment parentComment = comment.getParentComment(); |
|
1054 |
+ if (parentComment != null) { |
|
1054 | 1055 |
receivers.remove(User.find.byId(comment.getParent().authorId)); |
1055 | 1056 |
receivers.add(User.find.byId(comment.getParentComment().authorId)); |
1057 |
+ |
|
1058 |
+ if (parentComment.authorId.equals(comment.authorId)) { // when parent comment author is writing sub-comment |
|
1059 |
+ for(Comment subComment: comment.getSiblingComments()) { |
|
1060 |
+ receivers.add(User.find.byId(subComment.authorId)); |
|
1061 |
+ } |
|
1062 |
+ } |
|
1056 | 1063 |
} |
1064 |
+ |
|
1057 | 1065 |
receivers.addAll(findEventWatchersByEventType(comment.projectId, eventType)); |
1058 | 1066 |
|
1059 | 1067 |
receivers.removeAll(findUnwatchers(parent.asResource())); |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?