diff --git a/app/models/comment.rb b/app/models/comment.rb index 6667f00..6bb9bec 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -100,12 +100,16 @@ class Comment < ActiveRecord::Base include Noosfero::Plugin::HotSpot def verify_and_notify - plugins.dispatch(:check_comment_for_spam, self) + check_for_spam unless spam? notify_by_mail end end + def check_for_spam + plugins.dispatch(:check_comment_for_spam, self) + end + def notify_by_mail if source.kind_of?(Article) && article.notify_comments? if !article.profile.notification_emails.empty? -- libgit2 0.21.2