]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/messages_controller.rb
Merge remote-tracking branch 'upstream/pull/5387'
[rails.git] / app / controllers / messages_controller.rb
index 658c43483b2b872d80b1393a2bfb54b7c205cdb7..7d86796b1ff18f0a62303851cf2457238817e987 100644 (file)
@@ -88,6 +88,16 @@ class MessagesController < ApplicationController
 
       @title = @message.title
 
 
       @title = @message.title
 
+      render :action => "new"
+    elsif message.sender == current_user
+      @message = Message.new(
+        :recipient => message.recipient,
+        :title => "Re: #{message.title.sub(/^Re:\s*/, '')}",
+        :body => "On #{message.sent_on} #{message.sender.display_name} wrote:\n\n#{message.body.gsub(/^/, '> ')}"
+      )
+
+      @title = @message.title
+
       render :action => "new"
     else
       flash[:notice] = t ".wrong_user", :user => current_user.display_name
       render :action => "new"
     else
       flash[:notice] = t ".wrong_user", :user => current_user.display_name