You are here

function spam_mark_comment_as_not_spam_action in Spam 6

Implementation of a Drupal action. Mark comment as not spam.

File

content/spam_content_comment.inc, line 449
Include file for integration with comments.

Code

function spam_mark_comment_as_not_spam_action(&$object, $context = array()) {

  // get the cid from the object
  if (isset($object->cid)) {
    $cid = $object->cid;
  }
  elseif (isset($context['cid'])) {
    $cid = $context['cid'];
  }

  // make sure we have a comment record
  if ($cid) {
    spam_mark_as_not_spam('comment', $cid);

    // record a message noting the action taken
    watchdog('action', 'Marked comment %cid as not spam.', array(
      '%cid' => $cid,
    ));
  }
}