         @robot.logger.error 'Error during data sync: '+JSON.stringify err
       @robot.logger.debug 'Everything synced, ready to go!'
       @emit 'synced', @
-

  send: (envelope, message) =>
    @robot.logger.debug 'Sending new message to conversation ' + envelope.room

    @post "message/send/#{envelope.room}", {message: message}, (err, resp) ->
      if err isnt null
        @robot.logger.error 'Unable to send a message: '+JSON.stringify err



  # Destroy Fleep session
  logout: ->
    @post 'account/logout', {}, (err, resp) =>
      if err isnt null
        return @robot.logger.error 'Unable to destroy Fleep session'
      @robot.logger.debug 'User session with Fleep closed.'
