app/ws/RadioTower.js
// Leaves a "chat room". See description above on how a room is defined.
Leaves a "chat room". See description above on how a room is defined.
Leaves a " chat room " . See description above on how a room is defined .
leave( message, raw, senderClientId ) {
      let client = ClientStore.clients.find( cl => cl.clientId === senderClientId )
      if ( !client ) { return winston.debug( `No client with id ${senderClientId} found in pid ${process.pid} (this is fine, it might be on another pid).` ) }
      if ( message.streamId ) message.roomName = `stream-${message.streamId}`
      if ( !message.roomName && message.resourceId && message.resourceId.trim( ) !== '' && message.resourceType && message.resourceId.trim( ) !== '' )
        message.roomName = `${message.resourceType}-${message.resourceId}`
      if ( !message.roomName ) return winston.error( `No roomName specified from client ${client.clientId}.` );
      let roomIndex = client.rooms.indexOf( message.roomName )
      if ( roomIndex !== -1 ) {
        client.rooms.splice( roomIndex, 1 )
        winston.debug( `Client with id ${senderClientId} left  ${message.roomName}.` )
      }
    }
leave ( message , raw , senderClientId ) { let client = ClientStore . clients . find ( cl => cl . clientId === senderClientId ) if ( ! client ) { return winston . debug ( ` ${ senderClientId } ${ process . pid } ` ) } if ( message . streamId ) message . roomName = ` ${ message . streamId } ` if ( ! message . roomName && message . resourceId && message . resourceId . trim ( ) !== '' && message . resourceType && message . resourceId . trim ( ) !== '' ) message . roomName = ` ${ message . resourceType } ${ message . resourceId } ` if ( ! message . roomName ) return winston . error ( ` ${ client . clientId } ` ) ; let roomIndex = client . rooms . indexOf ( message . roomName ) if ( roomIndex !== - 1 ) { client . rooms . splice ( roomIndex , 1 ) winston . debug ( ` ${ senderClientId } ${ message . roomName } ` ) } }
Leaves a "chat room".
Leaves a " chat room " .
// TODO // again, backwards compatibility // just in case, if no room name, assemble it from resourceid and resource type // if still no room  name, exit left