]> source.dussan.org Git - redmine.git/commitdiff
Fixed that "RE:" prefix is added to the subject each time the message is quoted ...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 13 Nov 2009 19:14:18 +0000 (19:14 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 13 Nov 2009 19:14:18 +0000 (19:14 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3038 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/messages_controller.rb

index 7dd0fbec9bb786f36fd5860bfb043a6aa95cb4ac..437d1a291cce6b0c5439668f62829dc73ad26d12 100644 (file)
@@ -94,10 +94,11 @@ class MessagesController < ApplicationController
     user = @message.author
     text = @message.content
     subject = @message.subject.gsub('"', '\"')
+    subject = "RE: #{subject}" unless subject.starts_with?('RE:')
     content = "#{ll(Setting.default_language, :text_user_wrote, user)}\\n> "
     content << text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\\n> ") + "\\n\\n"
     render(:update) { |page|
-      page << "$('reply_subject').value = \"RE: #{subject}\";"
+      page << "$('reply_subject').value = \"#{subject}\";"
       page.<< "$('message_content').value = \"#{content}\";"
       page.show 'reply'
       page << "Form.Element.focus('message_content');"