diff options
Diffstat (limited to 'modules/akismet/helpers/akismet_event.php')
-rw-r--r-- | modules/akismet/helpers/akismet_event.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/akismet/helpers/akismet_event.php b/modules/akismet/helpers/akismet_event.php index 8f530faa..2a42acb3 100644 --- a/modules/akismet/helpers/akismet_event.php +++ b/modules/akismet/helpers/akismet_event.php @@ -19,9 +19,14 @@ */ class akismet_event_Core { public static function comment_created($comment) { + if (TEST_MODE) { + return; + } + switch(akismet::check_comment($comment)) { case "spam": $comment->state = "spam"; + module::incr_var("comment", "spam_caught"); break; case "ham": @@ -34,4 +39,16 @@ class akismet_event_Core { } $comment->save(); } + + public static function comment_changed($old, $new) { + if (TEST_MODE) { + return; + } + + if ($old->state != "spam" && $new->state == "spam") { + akismet::submit_spam($new); + } else if ($old->state == "spam" && $new->state != "spam") { + akismet::submit_ham($new); + } + } } |