X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5449cf4adcc1fad4b9f43426e6d3e4a8f65e6fbb..36497d8268524daa3edc6d52c82ef3d81112c740:/app/controllers/message_controller.rb diff --git a/app/controllers/message_controller.rb b/app/controllers/message_controller.rb index 8f866e512..183f8004a 100644 --- a/app/controllers/message_controller.rb +++ b/app/controllers/message_controller.rb @@ -2,6 +2,7 @@ class MessageController < ApplicationController layout 'site' before_filter :authorize_web + before_filter :set_locale before_filter :require_user before_filter :check_database_readable before_filter :check_database_writable, :only => [:new, :reply, :mark] @@ -36,8 +37,7 @@ class MessageController < ApplicationController message = Message.find(params[:message_id], :conditions => ["to_user_id = ? or from_user_id = ?", @user.id, @user.id ]) @body = "On #{message.sent_on} #{message.sender.display_name} wrote:\n\n#{message.body.gsub(/^/, '> ')}" @title = "Re: #{message.title.sub(/^Re:\s*/, '')}" - @user_id = message.from_user_id - @to_user = User.find(message.to_user_id) + @to_user = User.find(message.from_user_id) render :action => 'new' rescue ActiveRecord::RecordNotFound render :action => 'no_such_user', :status => :not_found