     # 3. Closing the browser window will cause the event to be triggered. 
     # 4. Even a page reload will first create an unload event.
     $(window).bind "unload", () =>
-      @socket.emit "leave", {
-        roomt: room
-        ident: self.Identifier
-        nickname: self.plugins.messageInput.getNickname()
-      } for room in self.rooms
+      @leaveChannel(room) for room in self.rooms
 
     # a channel join event.
     @socket.on "join", (data) => console.log "join",data


  getMessage: -> @messageInput.val()

class WireRoom
  plugins: {}


      "reconnection delay": 500
      "max reconnection attempts": 10
    })

    @tabs = new UITab($('#channelTabs'))

    @plugins.status = new WireRoomConnectionStatus(this, $('#connectionStatus') )
    @plugins.messageInput = new WireRoomMessageInput(this)
