Skip to content

Commit

Permalink
Join rooms automatically when invited
Browse files Browse the repository at this point in the history
  • Loading branch information
powdahound committed Dec 19, 2011
1 parent 4db1b19 commit 6b228eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -13,7 +13,7 @@
"url" : "http://github.com/hipchat/hubot-hipchat.git"
},
"dependencies": {
"wobot": "0.4.0"
"wobot": "0.6.0"
},
"devDependencies": {
"coffee-script": "1.1.3"
Expand Down
5 changes: 5 additions & 0 deletions src/hipchat.coffee
Expand Up @@ -72,6 +72,11 @@ class HipChat extends Adapter
author.reply_to = from
self.receive new Robot.TextMessage(author, "#{self.robot.name}: #{message}")

# Join rooms automatically when invited
bot.onInvite (room_jid, from_jid, message) =>
console.log "Got invite to #{room_jid} from #{from_jid} - joining"
bot.join room_jid

bot.connect()

@bot = bot
Expand Down

0 comments on commit 6b228eb

Please sign in to comment.