You are here

function nodejs_set_user_presence_list in Node.js integration 8

Same name and namespace in other branches
  1. 6 nodejs.module \nodejs_set_user_presence_list()
  2. 7 nodejs.module \nodejs_set_user_presence_list()

Set the list of uids a user can see presence notifications for.

s

Parameters

$uid:

File

./nodejs.module, line 153

Code

function nodejs_set_user_presence_list($uid, array $uids) {

  // Http request went ok. Process Node.js server response.
  if ($node_response = nodejs_get_nodejs()
    ->setUserPresenceList($uid, $uids)) {
    if ($node_response->status == 'success') {
      return TRUE;
    }
    else {
      \Drupal::logger('nodejs')
        ->error(t('Error setting user presence list for uid "%uid" on the Node.js server. Server response: %error', array(
        '%uid' => $uid,
        '%error' => $node_response->error,
      )));
      return FALSE;
    }
  }
  else {
    return FALSE;
  }
}