Don't send a noification email if somebody comments on their own diary

entry. Fixes #2053.
This commit is contained in:
Tom Hughes 2009-07-11 13:24:57 +00:00
parent 229e166eb3
commit f5e14bcc48

View 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
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'