 
     @ownMachinesList.addMachineBoxes data.own
     @sharedMachinesList.addMachineBoxes sharedData
+
+    @isMachinesListed = yes
+    @emit 'MachinesListed'
 
 
   createMachineList: (type, options, data) ->

    environmentDataProvider.fetch => @sections.messages.reload()


  machinesListed = no
  whenMachinesRendered: ->

    new Promise (resolve) =>
      return resolve()  if machinesListed
      @once 'MachinesListed', ->
        machinesListed = yes
        resolve()


  handleWorkspaceUnreadCounts: (chatData) ->

    @whenMachinesRendered().then =>
      chatData
        .filter  (data) => @workspaceItemChannelMap[data._id]
        .forEach (data) => @setWorkspaceUnreadCount data, data.unreadCount


  # addNewWorkspace: (machineData) ->


  setWorkspaceUnreadCount: (data, unreadCount) ->

    channelId = data._id
    provider  = environmentDataProvider

    provider.getMachineAndWorkspaceByChannelId channelId, (machine, workspace) =>
      if machine and workspace
        box    = @getMachineBoxByMachineUId machine.uid
        wsItem = box?.getWorkspaceItemByChannelId channelId

        if wsItem
          wsItem.setUnreadCount unreadCount

          return  unless unreadCount is 0

          { socialapi } = kd.singletons

          socialapi.channel.updateLastSeenTime channelId : data._id, kd.noop


  handleFollowedFeedUpdate: (update) ->
