/src/jira_patches/AbstractCommentHandler.java.patch
Patch | 49 lines | 45 code | 4 blank | 0 comment | 0 complexity | de31658c5bff55b1237e1263f8c6bdcb MD5 | raw file
- --- ../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);
- }
-