You are here

function nodejs_add_user_to_channel in Node.js integration 6

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

Add a user to a channel.

Parameters

mixed $uid:

mixed $channel:

Return value

boolean

2 calls to nodejs_add_user_to_channel()
nodejs_add_user_to_channel_form_submit in ./nodejs.module
Form submit callback - add a user to a channel on the Node.js server.
nodejs_subscribe_insert in nodejs_subscribe/nodejs_subscribe.module
Create subscription to a node for a given user.

File

./nodejs.module, line 559

Code

function nodejs_add_user_to_channel($uid, $channel) {
  $result = Nodejs::addUserToChannel($uid, $channel);
  if (isset($result->error)) {
    $params = array(
      '%uid' => $uid,
      '%channel' => $channel,
      '%code' => $result->code,
      '%error' => $result->error,
    );
    watchdog('nodejs', t('Error adding user %uid to channel %channel on Node.js server: [%code] %error', $params));
    return (object) array();
  }
  else {
    return TRUE;
  }
}