From: Tom Hughes Date: Sat, 11 Jul 2009 13:24:57 +0000 (+0000) Subject: Don't send a noification email if somebody comments on their own diary X-Git-Tag: live~6856 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/f5e14bcc48725c13c36102f365812052d0a413cf Don't send a noification email if somebody comments on their own diary entry. Fixes #2053. --- diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index 7a442ac58..48cdda8a0 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -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'