You are here

function cleantalk_comment_presave in Anti Spam by CleanTalk 7.5

Same name and namespace in other branches
  1. 8.4 cleantalk.module \cleantalk_comment_presave()
  2. 8 cleantalk.module \cleantalk_comment_presave()
  3. 8.3 cleantalk.module \cleantalk_comment_presave()
  4. 7 cleantalk.module \cleantalk_comment_presave()
  5. 7.2 cleantalk.module \cleantalk_comment_presave()
  6. 7.4 cleantalk.module \cleantalk_comment_presave()
  7. 9.1.x cleantalk.module \cleantalk_comment_presave()

Implements hook_comment_presave().

File

./cleantalk.module, line 184
Main CleanTalk integration module functions.

Code

function cleantalk_comment_presave($comment) {
  $ct_result = CleantalkFuncs::_cleantalk_ct_result();
  if (!empty($ct_result['ct_request_id'])) {
    if ($ct_result['ct_result_allow'] === 0 && variable_get('cleantalk_check_comments_automod', 0) === 1) {
      $comment->status = COMMENT_NOT_PUBLISHED;
    }
  }
}