diff --git a/app/ws/RadioTower.js b/app/ws/RadioTower.js index 7c58e145..995330a0 100644 --- a/app/ws/RadioTower.js +++ b/app/ws/RadioTower.js @@ -85,13 +85,14 @@ module.exports = { let roomName = '' if ( message.streamId && message.streamId.trim( ) !== '' ) { roomName = `stream-${message.streamId}` - } else if ( !( !message.resourceId || !message.resourceType ) ) + } 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}: ${message.args.eventType}` ) + 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 ) } }