]> git.openstreetmap.org Git - rails.git/commitdiff
Send replies to the right user. Closes #1720.
authorTom Hughes <tom@compton.nu>
Sun, 19 Apr 2009 10:36:04 +0000 (10:36 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 19 Apr 2009 10:36:04 +0000 (10:36 +0000)
app/controllers/message_controller.rb

index 8f866e512c388fda530304d0da6a84f793268f73..2f71107f4b39e35720b78193d549a6f716d74e83 100644 (file)
@@ -36,8 +36,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*/, '')}"
     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
     render :action => 'new'
   rescue ActiveRecord::RecordNotFound
     render :action => 'no_such_user', :status => :not_found