diff --git a/lib/noosfero/plugin.rb b/lib/noosfero/plugin.rb index 6db0ae9..4feba9f 100644 --- a/lib/noosfero/plugin.rb +++ b/lib/noosfero/plugin.rb @@ -226,12 +226,55 @@ class Noosfero::Plugin # example: # # def filter_comment(comment) - # comment.reject! if anti_spam_service.is_spam?(comment) + # if user_not_logged_in + # comment.reject! + # end # end # def filter_comment(comment) end + # This method is called by the CommentHandler background job before sending + # the notification email. If the comment is marked as spam (i.e. by calling + # comment.spam!), then the notification email will *not* be sent. + # + # example: + # + # def check_comment_for_spam(comment) + # if anti_spam_service.is_spam?(comment) + # comment.spam! + # end + # end + # + def check_comment_for_spam(comment) + end + + # This method is called when the user manually marks a comment as SPAM. A + # plugin implementing this method should train its spam detection mechanism + # by submitting this comment as a confirmed spam. + # + # example: + # + # def comment_marked_as_spam(comment) + # anti_spam_service.train_with_spam(comment) + # end + # + def comment_marked_as_spam(comment) + end + + # This method is called when the user manually marks a comment a NOT SPAM. A + # plugin implementing this method should train its spam detection mechanism + # by submitting this coimment as a confirmed ham. + # + # example: + # + # def comment_marked_as_ham(comment) + # anti_spam_service.train_with_ham(comment) + # end + # + def comment_marked_as_ham(comment) + end + # -> Adds fields to the signup form # returns = lambda block that creates html code def signup_extra_contents -- libgit2 0.21.2