X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2f66877696957886b9c75026c9133c1d5430d772..f7d4fa057a0098a8a98f251f2118453ec6e376ad:/app/controllers/messages_controller.rb diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 658c43483..7d86796b1 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -88,6 +88,16 @@ class MessagesController < ApplicationController @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