app/ws/RadioTower.js
// Broadcasts a message to a 'chat room'. See description above on how a room is defined.
Broadcasts a message to a 'chat room'. See description above on how a room is defined.
Broadcasts a message to a ' chat room ' . See description above on how a room is defined .
broadcast( message, raw, senderClientId ) {
      let roomName = ''
      if ( message.streamId && message.streamId.trim( ) !== '' ) {
        roomName = `stream-${message.streamId}`
      } else if ( !( !message.resourceId || !message.resourceType ) ) {
        roomName = `${message.resourceType}-${message.resourceId}`
      }
      if ( roomName === '' ) {
        return winston.debug( `Failed to deliver broadcast from ${senderClientId} (no room name).` )
      }
      winston.debug( `📣 broadcast in ${roomName} from ${senderClientId}` )
      for ( let ws of ClientStore.clients ) {
        if ( ws.clientId !== senderClientId && ws.rooms.indexOf( roomName ) !== -1 ) { ws.send( raw ) }
      }
    }
broadcast ( message , raw , senderClientId ) { let roomName = '' if ( message . streamId && message . streamId . trim ( ) !== '' ) { roomName = ` ${ message . streamId } ` } else if ( ! ( ! message . resourceId || ! message . resourceType ) ) { roomName = ` ${ message . resourceType } ${ message . resourceId } ` } if ( roomName === '' ) { return winston . debug ( ` ${ senderClientId } ` ) } winston . debug ( ` oo mName} f r en derClientId}`  ) for ( let ws of ClientStore . clients ) { if ( ws . clientId !== senderClientId && ws . rooms . indexOf ( roomName ) !== - 1 ) { ws . send ( raw ) } } }
Broadcasts a message to a 'chat room'.
Broadcasts a message to a ' chat room ' .
// TODO: Shame whoever wrote the boolean logic below...