The <title> wasn't being properly set on /message/new/$user, only on /message/new...
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 22 Jun 2009 19:13:54 +0000 (19:13 +0000)
committerÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 22 Jun 2009 19:13:54 +0000 (19:13 +0000)
app/controllers/message_controller.rb

index 2e5e09b45864611bb58328244a63aa45b637ddd3..6c7be5e0f575cac11120cbb5040787e2472982cb 100644 (file)
@@ -12,7 +12,6 @@ class MessageController < ApplicationController
   # clicks send.
   # The display_name param is the display name of the user that the message is being sent to.
   def new
-    @title = t 'message.new.title'
     @to_user = User.find_by_display_name(params[:display_name])
     if @to_user
       if params[:message]
@@ -27,7 +26,13 @@ class MessageController < ApplicationController
           redirect_to :controller => 'message', :action => 'inbox', :display_name => @user.display_name
         end
       else
-        @title = params[:title]
+        if params[:title]
+          # ?title= is set when someone reponds to this user's diary entry
+          @title = params[:title]
+        else
+          # The default /message/new/$user view
+          @title = t 'message.new.title'
+        end
       end
     else
       @title = t'message.no_such_user.title'