You are here

function spam_notspam_comment in Spam 5

Mark the comment as not spam. This may cause the comment to become published depending on settings

1 string reference to 'spam_notspam_comment'
spam_comment_operations in ./spam.module
Return the function to call dependant on the $action requested.

File

./spam.module, line 3048

Code

function spam_notspam_comment($cid) {
  if ($comment = spam_load_comment($cid)) {
    $tokens = spam_tokenize($comment->subject, 'header*');
    $tokens = array_merge($tokens, spam_tokenize("{$comment->comment} {$comment->name} {$comment->mail} {$comment->homepage}"));
    spam_tokens_unsave($tokens, 0);
    spam_tokens_save($tokens, 0);
    db_query("UPDATE {spam_tracker} SET probability = %d, timestamp = %d WHERE source = 'comment' AND id = %d", 1, time(), $cid);
    spam_default_actions('comment', $cid, $comment->subject, $comment->comment, 1, NULL, FALSE);
    spam_log(SPAM_LOG, t('spam_page: comment manually marked as not spam'), 'comment', $comment->cid);
  }
}