summaryrefslogtreecommitdiffstats
path: root/app/models/mail_handler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/mail_handler.rb')
-rw-r--r--app/models/mail_handler.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 8a5925cab..3eacf3c19 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -181,7 +181,7 @@ class MailHandler < ActionMailer::Base
end
# Adds a note to an existing issue
- def receive_issue_reply(issue_id)
+ def receive_issue_reply(issue_id, from_journal=nil)
issue = Issue.find_by_id(issue_id)
return unless issue
# check permission
@@ -196,6 +196,10 @@ class MailHandler < ActionMailer::Base
@@handler_options[:issue].clear
journal = issue.init_journal(user)
+ if from_journal && from_journal.private_notes?
+ # If the received email was a reply to a private note, make the added note private
+ issue.private_notes = true
+ end
issue.safe_attributes = issue_attributes_from_keywords(issue)
issue.safe_attributes = {'custom_field_values' => custom_field_values_from_keywords(issue)}
journal.notes = cleaned_up_text_body
@@ -211,7 +215,7 @@ class MailHandler < ActionMailer::Base
def receive_journal_reply(journal_id)
journal = Journal.find_by_id(journal_id)
if journal && journal.journalized_type == 'Issue'
- receive_issue_reply(journal.journalized_id)
+ receive_issue_reply(journal.journalized_id, journal)
end
end