         Loading      : => kd.utils.defer => @onCollaborationLoading()
         Resuming     : @bound 'onCollaborationResuming'
         NotStarted   : @bound 'onCollaborationNotStarted'
+        Preparing    : @bound 'onCollaborationPreparing'
         Prepared     : @bound 'onCollaborationPrepared'
         Creating     : @bound 'onCollaborationCreating'
         Active       : @bound 'onCollaborationActive'

  showChat: ->

    switch @stateMachine.state
      when 'Active'
       @showChatPane()
      when 'NotStarted'
        @prepareChatSession
          success : => @stateMachine.transition 'Prepared'
          error   : => # @stateMachine.transition 'ErrorPreparing'


  stopCollaborationSession: ->

          @workspaceData.channelId = channel.id
          @chat.ready => callbacks.success()
        .error (err) => callbacks.error err


  onCollaborationPreparing: ->

    @prepareChatSession
      success : => @stateMachine.transition 'Prepared'
      error   : => @stateMachine.transition 'ErrorPreparing'


  onCollaborationPrepared: ->
