     if @rtm?.isReady
     then callback()
     else @once 'RTMIsReady', callback
-
-
-  showChat: ->
-
-    return @createChatPane()  unless @chat
-
-    @chat.start()
-
-
-  createChatPane: ->
-
-    @startChatSession (err, channel) =>
-
-      return showError err  if err
-
-      @createChatPaneView channel
-
-
-  createChatPaneView: (channel) ->
-    return throwError 'RealtimeManager is not set'  unless @rtm
-
-    options = { @rtm, @isInSession }
-    @getView().addSubView @chat = new IDEChatView options, channel
-    @chat.show()
-
-    @on 'RTMIsReady', =>
-      @listChatParticipants (accounts) =>
-        @chat.settingsPane.createParticipantsList accounts
-
-      @statusBar.emit 'CollaborationStarted'
-
-      {settingsPane} = @chat
-
-      settingsPane.on 'ParticipantKicked', @bound 'handleParticipantKicked'
-      settingsPane.updateDefaultPermissions()
 
 
   kickParticipant: (account) ->

      callback accounts


  continuePrivateMessage: (callback) ->

    @chat.emit 'CollaborationStarted'

    @listChatParticipants (accounts) =>
      @statusBar.emit 'ShowAvatars', accounts, @participants.asArray()

    callback null


  startChatSession: (callback) ->

    if @getSocialChannelId()
    then @reactivateChatSession callback
    else @initPrivateMessage callback


  reactivateChatSession: (callback) ->

    @fetchSocialChannel (err, channel) =>
      if err or not channel
        return @initPrivateMessage callback

      @createChatPaneView channel
      @isRealtimeSessionActive channel.id, (isActive, file) =>
        if isActive
          @whenRealtimeReady => @continuePrivateMessage callback
          return @loadCollaborationFile file.id

        @statusBar.share.show()
        @chat.emit 'CollaborationNotInitialized'


  getRealtimeFileName: (id) ->

    id or= @getSocialChannelId()


    if @permissions.get(nick()) is 'read'
      @makeReadOnly()


  reviveHostSnapshot: ->
