diff --git a/webpack/lib/room-controller.js b/webpack/lib/room-controller.js index 32f1f19..90bbdcf 100644 --- a/webpack/lib/room-controller.js +++ b/webpack/lib/room-controller.js @@ -38,14 +38,19 @@ export default class RoomController{ if( Object.keys(room).length == 0 ) return false; - /* (3) Update @active room */ - this[type].current = room.id; + /* (3) VOICE room : toggle @active */ + if( type === 'voice' ) + this[type].current = (this[type].current === room.id) ? null : room.id; - /* (4) Open new room */ + /* (4) Update @active room */ + if( type === 'text' ) + this[type].current = room.id; + + /* (5) Tell websocket: new text room */ if( type === 'text' && csock instanceof wscd ) csock.send({ buffer: { rid: room.id } }); - /* (5) Update buffer */ + /* (6) Update buffer */ this._buffer[type] = {}; for( let r of this[type].list ) if( r.id === this[type].current )