ccmailer-44x /src/jira_patches/AbstractCommentHandler.java.patch

Language Patch File Lines 50
MD5 Hash de31658c5bff55b1237e1263f8c6bdcb
Repository https://bitbucket.org/redradish/ccmailer-44x View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- ../atlassian-jira-4.4.5-source/jira-project/jira-components/jira-core/src/main/java/com/atlassian/jira/service/util/handler/AbstractCommentHandler.java	2012-02-15 21:13:22.000000000 +1100
+++ src/main/java/com/atlassian/jira/service/util/handler/redradish/AbstractCommentHandler.java	2012-03-14 12:39:41.364177644 +1100
@@ -1,5 +1,7 @@
-package com.atlassian.jira.service.util.handler;
-
+package com.atlassian.jira.service.util.handler.redradish;
+// CCMailer: Overridden to define and use createComment
+import com.atlassian.jira.service.util.handler.AbstractMessageHandler;
+import com.atlassian.jira.issue.MutableIssue;
 import com.atlassian.core.util.map.EasyMap;
 import com.atlassian.jira.ComponentManager;
 import com.atlassian.jira.JiraApplicationContext;
@@ -103,7 +105,7 @@
                         }
 
                         IssueFactory issueFactory = ComponentManager.getComponent(IssueFactory.class);
-                        Comment comment = commentManager.create(issueFactory.getIssue(issue), reporter.getName(), body, null, null, false);
+                        Comment comment = createComment(issueFactory.getIssue(issue), reporter.getName(), body);
 
                         // Record the message id of this e-mail message so we can track replies to this message
                         // and associate them with this issue
@@ -155,6 +157,18 @@
         return false; // Dont delete message
     }
 
+    /**
+     * Create the comment, without dispatching any events (added for CCMailer).
+     * @param issue Issue to create comment on
+     * @param commenterUsername Comment reporter
+     * @param body Comment body
+     * @return
+     */
+    protected Comment createComment(MutableIssue issue, String commenterUsername, String body)
+    {
+        return commentManager.create(issue, commenterUsername, body, null, null, false);
+    }
+
     private void update(Collection attachmentsChangeItems, GenericValue issue, User reporter, Comment comment)
             throws JiraException
     {
@@ -168,7 +182,7 @@
         issueUpdateBean.setComment(comment);
         if (attachmentsChangeItems != null && !attachmentsChangeItems.isEmpty())
         {
-            // If there were attachments added, add their change items to the issueUpdateBean 
+            // If there were attachments added, add their change items to the issueUpdateBean
             issueUpdateBean.setChangeItems(attachmentsChangeItems);
         }
 
Back to Top