     when 'shared'         then isPermanent
     when 'collaboration'  then not isPermanent
 
+  ideApp = environmentDataProvider.getIDEFromUId machine.get('uid')
+
   async.series([
     (callback) ->
 


    (callback) ->

      if denyMachine
        environmentDataProvider.getIDEFromUId(machine.get('uid'))?.quit()

      actionType = if machine.get('type') is 'collaboration'
      then 'COLLABORATION_INVITATION_REJECTED'


      return callback()  unless machine.get('type') is 'collaboration'

      # Do not call social api from here if there is an ide app instance.
      # Because it will be called it in next queue item by "quit()" method instead of this queue.
      # You can check "stopCollaborationSession" method of collaborationcontroller.coffee
      # ~TURUNC
      return callback()  if ideApp and denyMachine

      { channel } = kd.singletons.socialapi
      workspace   = machine.get('workspaces').first()
      channelId   = workspace.get 'channelId'
