   stateEnum = {
     INITIAL: 0
     START_PENDING: 1,
-    STARTED: 2,
-    KILLED: 3
+    ACTIVE: 2,
+    TERMINATED: 3
   }
 
   constructor: ->

      type: 'DELETE'
    console.log "Chat Terminated"

    @state = stateEnum.KILLED
    console.log "Chat Client Chat Terminated"

        if (event.type == 'participantStateChanged' &&
            event.state == 'disconnected' &&
            event.participant_type == 'WebUser')
          @state = stateEnum.TERMINATED

      setTimeout () =>
        @pollMessages()
      , 1000 if @state == stateEnum.ACTIVE || @state == stateEnum.START_PENDING

  sendMessage: (message) ->
    return unless message
    return @queueMessage(message) unless @state == stateEnum.ACTIVE

    $.post @endpoint, { event: { content: message } }, (data) =>
      @renderMessages data.events
