]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entry_controller.rb
Allow messages to be deleted from the outbox as well as the inbox.
[rails.git] / app / controllers / diary_entry_controller.rb
index 9471872279bc8cadce1664e44e4dc13faf6924de..48cdda8a03df2823b55684ccd63d3265b41496ce 100644 (file)
@@ -54,7 +54,10 @@ class DiaryEntryController < ApplicationController
     @diary_comment = @entry.diary_comments.build(params[:diary_comment])
     @diary_comment.user = @user
     if @diary_comment.save
-      Notifier::deliver_diary_comment_notification(@diary_comment)
+      if @diary_comment.user != @entry.user
+        Notifier::deliver_diary_comment_notification(@diary_comment)
+      end
+
       redirect_to :controller => 'diary_entry', :action => 'view', :display_name => @entry.user.display_name, :id => @entry.id
     else
       render :action => 'view'
@@ -131,6 +134,7 @@ class DiaryEntryController < ApplicationController
       if @entry
         @title = t 'diary_entry.view.title', :user => params[:display_name]
       else
+        @title = t 'diary_entry.no_such_entry.title', :id => params[:id]
         render :action => 'no_such_entry', :status => :not_found
       end
     else