function heartbeat_get_reactions in Heartbeat 7
Same name and namespace in other branches
- 6.4 modules/heartbeat_comments/heartbeat_comments.module \heartbeat_get_reactions()
Function to fetch reactions on a heartbeat message.
2 calls to heartbeat_get_reactions()
- HeartbeatActivityCommentsPlugin::loadAttachments in modules/
heartbeat_comments/ plugins/ activitycomments.inc - loadAttachments().
- 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 134 - Heartbeat comments for activity.
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, $uaid);
}
return $node_comments[$node->nid];
}
else {
static $reactions = array();
if (!isset($reactions[$uaid])) {
$reactions[$uaid] = heartbeat_get_message_reactions($uaid, $all);
}
return $reactions[$uaid];
}
}