You are here

function comment_comment in Spam 5.3

Drupal _comment() hook.

File

modules/spam_comment.inc, line 8

Code

function comment_comment(&$comment, $op) {
  switch ($op) {
    case 'update':
      spam_content_update($comment, 'comment');
      break;
    case 'insert':
      spam_content_insert($comment, 'comment');
      break;
    case 'delete':
      spam_content_delete($comment, 'comment');
      break;
    case 'form':
      if (is_array($comment['cid'])) {
        _spam_comment_cid($comment['cid']['#value']);
      }
      break;
    case 'view':
      if (spam_score_is_spam(_spam_comment_score($comment->cid))) {
        $comment->status = COMMENT_NOT_PUBLISHED;
      }
      break;
  }
}