 
       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...) ->


  online: =>
    console.log 'Hubot XMPP client online'
    
    @client.send new Xmpp.Element('presence', type: 'available' )
      .c('show').t('chat')



    # 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...) ->
