X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/eab2eeaa47b2aa8c7f52371f9bfdd60711a41fb6..91dac23254c3674bee23cfd33fbedc2c4380924b:/app/controllers/message_controller.rb diff --git a/app/controllers/message_controller.rb b/app/controllers/message_controller.rb index fd638e4e7..c7acc90d8 100644 --- a/app/controllers/message_controller.rb +++ b/app/controllers/message_controller.rb @@ -24,14 +24,14 @@ class MessageController < ApplicationController if @message.save flash[:notice] = t 'message.new.message_sent' - Notifier.message_notification(@message).deliver + Notifier.message_notification(@message).deliver_now redirect_to :controller => 'message', :action => 'inbox', :display_name => @user.display_name end end - else - @message = Message.new(:recipient => @this_user) - @title = t 'message.new.title' end + + @message ||= Message.new(:recipient => @this_user) + @title = t 'message.new.title' end # Allow the user to reply to another message.