You are here

function heartbeat_get_related_uids in Heartbeat 6.4

Same name and namespace in other branches
  1. 6.3 heartbeat.module \heartbeat_get_related_uids()

Function calculates all related uids for given uid.

Parameters

$uid Integer User id.:

2 calls to heartbeat_get_related_uids()
ConnectedHeartbeat::whoIsActor in modules/friendlist_activity/connectedheartbeat.inc
proctected fuinction whoIsActor Add the heartbeat relations for the stream's active user.
HeartbeatMessageBuilder::checkAccess in includes/heartbeatmessagebuilder.inc
Function to check access on messages This behaviour is set by a heartbeat message configuration to overrule the chosen display access type

File

./heartbeat.module, line 1585

Code

function heartbeat_get_related_uids($uid) {
  static $uids;
  if (!isset($uids[$uid])) {
    $uids[$uid] = array();

    // all the messages where the current uid is in the friendlist
    // if function exists use it
    $related_uids = module_invoke_all('heartbeat_related_uid_info', $uid);
    $related_uids[$uid] = $uid;
    if (count($related_uids) > 0) {
      foreach ($related_uids as $rel_uid) {
        $uids[$uid][$rel_uid] = $rel_uid;
      }
    }
  }
  return array_unique($uids[$uid]);
}