   run: ->
     Xmpp.JID.prototype.from = -> @bare().toString()
 
+    @name = 'Hubot'
+	
     # Client Options
     @options = 
       username: process.env.HUBOT_GTALK_USERNAME

      port: @options.port

    # Events
    @client.on 'online', @online
    @client.on 'stanza', @readStanza
    @client.on 'error', @error

  online: ->
    @client.send new Xmpp.Element('presence')
    
    # He is alive!
    console.log @name + ' is online, talk.google.com!'


    return unless body

    message = body.getText()
    console.log 'Body:', message

    # Pad the message with robot name just incase it was not provided.
    message = if not message.match(new RegExp("^"+@name+":?","i")) then @name + " " + message else message

    # Send the message to the robot
    user = @getUser jid
    @receive new Robot.TextMessage(user, message)

  handlePresence: (stanza) ->
    jid = new Xmpp.JID(stanza.attrs.from)
