You are here

function og_comment in Organic groups 5.2

Same name and namespace in other branches
  1. 5 og.module \og_comment()
  2. 5.7 og.module \og_comment()

File

./og.module, line 1621

Code

function og_comment($comment, $op) {
  switch ($op) {
    case 'publish':
      $comment = (array) $comment;

    // fall through
    case 'insert':

      // would prefer that these are sent with some delay to prevent give author time to correct typos. where is my cron based send?
      if ($comment['status'] == COMMENT_PUBLISHED && !module_exists('og2list')) {
        $node = node_load($comment['nid']);
        $comment['og_groups'] = $node->og_groups;
        $comment['title'] = $node->title;
        $comment['msgid'] = $comment['nid'] . '-' . $comment['cid'] . og_msgid_server();
        $reply = $comment['nid'] . '-';
        if ($comment['pid']) {
          $reply .= $comment['pid'];
        }
        else {
          $reply .= '0';
        }
        $comment['in_reply_to'] .= $reply . og_msgid_server();
        og_mail('comment', (object) $comment);
      }
      break;
  }
}