 
       to = if user.type in ['direct', 'chat'] then user.room + '/' + user.id else user.room
 
-      message = new Xmpp.Element('message', 
+      message = new Xmpp.Element('message',
                   from: @options.username
                   to: to
                   type: user.type
                 ).
                 c('body').t(str)
-      
+
       @client.send message
 
   reply: (user, strings...) ->


    # ignore our own messages
    return if @options.username in stanza.attrs.from
      
    # ignore empty bodies (i.e., topic changes -- maybe watch these someday)
    body = stanza.getChild 'body'
    return unless body
    
    message = body.getText()
    
    [room, from] = stanza.attrs.from.split '/'
    user = new Robot.User from, {
      room: room
      type: stanza.attrs.type
    }
    
    @receive new Robot.TextMessage user, message

  send: (user, strings...) ->

        .c('history', seconds: 1 )) # prevent the server from confusing us with old messages
                                    # and it seems that servers don't reliably support maxchars
                                    # or zero values

    # send raw whitespace for keepalive
    setInterval =>
      @client.send ' '
    , @options.keepaliveInterval
