You are here

function nodejs_send_channel_message in Node.js integration 6

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

Send a message to all users subscribed to a given channel.

File

./nodejs.module, line 116

Code

function nodejs_send_channel_message($channel, $subject, $body) {
  $message = (object) array(
    'broadcast' => FALSE,
    'data' => (object) array(
      'subject' => $subject,
      'body' => $body,
    ),
    'channel' => $channel,
  );
  nodejs_enqueue_message($message);
}