You are here

function nodejs_remove_user_from_channel in Node.js integration 7

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

Remove a user from a channel.

Parameters

mixed $uid:

mixed $channel:

Return value

boolean

1 call to nodejs_remove_user_from_channel()
nodejs_subscribe_delete in nodejs_subscribe/nodejs_subscribe.module
Delete a subscription to a node.

File

./nodejs.module, line 725

Code

function nodejs_remove_user_from_channel($uid, $channel) {

  // Http request went ok. Process Node.js server response.
  if ($node_response = Nodejs::removeUserFromChannel($uid, $channel)) {
    if ($node_response->status == 'success') {
      return TRUE;
    }
    else {
      $params = array(
        '%uid' => $uid,
        '%channel' => $channel,
        '%error' => $node_response->error,
      );
      watchdog('nodejs', 'Error removing user with uid: %uid from channel %channel on the Node.js server. Server response: %error', $params);
      return FALSE;
    }
  }
  else {
    return FALSE;
  }
}