You are here

function heartbeat_get_reactions in Heartbeat 6.4

Same name and namespace in other branches
  1. 7 modules/heartbeat_comments/heartbeat_comments.module \heartbeat_get_reactions()

Function to fetch reactions on a heartbeat message.

2 calls to heartbeat_get_reactions()
heartbeat_comments_heartbeat_load in modules/heartbeat_comments/heartbeat_comments.module
Implementation of hook_heartbeat_load().
heartbeat_comments_load_js in modules/heartbeat_comments/heartbeat_comments.module
Ajax callback to load all the comments.

File

modules/heartbeat_comments/heartbeat_comments.module, line 259
heartbeat_comments.module Heartbeat comments can come with two possible

Code

function heartbeat_get_reactions($uaid, $node_comment, $node = NULL, $all = FALSE) {
  if ($node_comment && isset($node)) {
    static $node_comments = array();
    if (!isset($node_comments[$node->nid])) {
      $node_comments[$node->nid] = heartbeat_get_node_comments($node, $all);
    }
    return $node_comments[$node->nid];
  }
  else {
    static $reactions = array();
    if (!isset($reactions[$uaid])) {
      $reactions[$uaid] = heartbeat_get_message_reactions($uaid, $all);
    }
    return $reactions[$uaid];
  }
}