[Notice] Announcing the End of Demo Server [Read me]
doortts doortts 2018-10-03
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
+++ app/models/NotificationEvent.java
@@ -1050,10 +1050,18 @@
         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()));
Add a comment
List