Skip to content
Browse files

fixup irc double posting issues, fixes #71

  • Loading branch information...
1 parent 5c76e7c commit 2ec62c3eb0f9001a86090f16d56e5e5b74ef8621 @atmos atmos committed Oct 28, 2011
Showing with 14 additions and 11 deletions.
  1. +1 −1 package.json
  2. +11 −8 src/hubot/irc.coffee
  3. +2 −2 src/templates/package.json
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "hubot",
- "version": "1.1.3",
+ "version": "1.1.4",
"author": "hubot",
"keywords": "github hubot campfire bot",
"description": "A simple helpful Robot for your Company",
View
19 src/hubot/irc.coffee
@@ -4,16 +4,18 @@ Irc = require "irc"
class IrcBot extends Robot
send: (user, strings...) ->
for str in strings
- if user.room
- console.log "#{user.room} #{str}"
- @bot.say(user.room, str)
- else
- console.log "#{user.name} #{str}"
- @bot.say(user.name, str)
+ do (str) ->
+ if user.room
+ console.log "#{user.room} #{str}"
+ @bot.say(user.room, str)
+ else
+ console.log "#{user.name} #{str}"
+ @bot.say(user.name, str)
reply: (user, strings...) ->
for str in strings
- @send user, "#{user.name}: #{str}"
+ do (str) ->
+ @send user, "#{user.name}: #{str}"
join: (channel) ->
self = @
@@ -58,7 +60,8 @@ class IrcBot extends Robot
bot.say 'NickServ', "identify #{options.nickpass}"
else if options.nickpass and from is 'NickServ' and text.indexOf('now identified') isnt -1
for room in options.rooms
- @join room
+ do (room) ->
+ @join room
bot.addListener 'message', (from, to, message) ->
console.log "From #{from} to #{to}: #{message}"
View
4 src/templates/package.json
@@ -15,8 +15,8 @@
},
"dependencies": {
- "hubot": ">= 1.1.3",
- "hubot-scripts": ">= 1.1.1",
+ "hubot": "1.1.4",
+ "hubot-scripts": "1.1.2",
"optparse": "1.0.1"
}
}

5 comments on commit 2ec62c3

@dannymcc

I seem to get duplicate responses from Hubot now in campfire (running on Heroku).

@atmos
atmos commented on 2ec62c3 Oct 28, 2011

Upgrade to 1.1.4

@dannymcc

I'm running 1.1.4, I think.

@atmos
atmos commented on 2ec62c3 Oct 28, 2011

Open and issue and link to the package.json file you're using.

@jacobk
jacobk commented on 2ec62c3 Oct 29, 2011

It seems to work fine if do => is used instead of do -> to ensure that this in bound correctly

Please sign in to comment.
Something went wrong with that request. Please try again.