Skip to content

Commit

Permalink
Fixed reply bug and updated dependency versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mexitek committed Oct 30, 2011
1 parent 38a53cc commit 097e852
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -22,8 +22,8 @@
"scoped-http-client": "0.9.4",
"irc": "0.2",
"node-xmpp": ">=0.2.6",
"simple-xmpp":"0.1.5beta",
"node-stringprep":"0.0.5",
"simple-xmpp":">= 0.1.5beta",
"node-stringprep":">= 0.0.5",
"wobot": "0.3.0"
},
"main": "./index",
Expand Down
12 changes: 8 additions & 4 deletions src/hubot/gtalk.coffee
Expand Up @@ -3,20 +3,24 @@ Xmpp = require 'simple-xmpp'

class Gtalkbot extends Robot
run: ->
# Connect to gtalk servers
new Xmpp.connect

# Client Options
options =
jid: process.env.HUBOT_GTALK_USERNAME
password: process.env.HUBOT_GTALK_PASSWORD
host: 'talk.google.com'
port: 5222

# Connect to gtalk servers
new Xmpp.connect options

# Events
Xmpp.on 'online', @.online
Xmpp.on 'chat', @.chat
Xmpp.on 'error', @.error

# Log options
#console.log options
console.log options

online: =>
console.log 'Hubot is online, talk.google.com!'
Expand All @@ -30,7 +34,7 @@ class Gtalkbot extends Robot

reply: (user, strings...) ->
for str in strings
@send user.name, "#{str}"
@send user, "#{str}"

error: (err) =>
console.error err
Expand Down

0 comments on commit 097e852

Please sign in to comment.