PageRenderTime 50ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/src/jira_patches/AbstractCommentHandler.java.patch

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