 
   validPost: ->
     @state.message.length != 0
+
+
+  submitIfEnter: (e) ->
+    return if e.keyCode != 13
+
+    e.preventDefault()
+    @post()

  setMessage: (e) ->
    newValue = e.target.value

    if _.last(newValue) != '\n'
      @setState message: e.target.value
    else
      @post()


  canUpdate: ->

          rows: 2
          value: @state.message
          onChange: @setMessage
          onKeyDown: @submitIfEnter

        div className: "#{bn}__actions",
          div className: "#{bn}__actions-group",
