You are here

function notifications_content_comment in Notifications 6

Same name and namespace in other branches
  1. 5 notifications_content/notifications_content.module \notifications_content_comment()
  2. 6.4 notifications_content/notifications_content.module \notifications_content_comment()
  3. 6.2 notifications_content/notifications_content.module \notifications_content_comment()
  4. 6.3 notifications_content/notifications_content.module \notifications_content_comment()

Implementation of hook_comment().

File

notifications_content/notifications_content.module, line 671
Subscriptions to content events

Code

function notifications_content_comment($comment, $op) {

  // $comment can be an object or an array.
  $comment = (object) $comment;
  if (($op == 'update' || $op == 'publish') && empty($comment->notifications_content_disable) && empty($comment->status)) {
    $node = node_load($comment->nid);
    if (notifications_content_type_enabled($node->type)) {
      $event = array(
        'module' => 'node',
        'uid' => $comment->uid,
        'type' => 'node',
        'action' => 'comment',
        'node' => $node,
        'comment' => $comment,
        'params' => array(
          'nid' => $comment->nid,
          'cid' => $comment->cid,
        ),
      );
    }
    notifications_event($event);
  }
}