Permalink
Browse files

revert bugs introduced in 2ec62c3

  • Loading branch information...
atmos committed Oct 29, 2011
1 parent 09e1a50 commit 23cd931d673a6f8275713deed862e86a45b1650c
Showing with 8 additions and 11 deletions.
  1. +8 −11 src/hubot/irc.coffee
View
@@ -4,18 +4,16 @@ Irc = require "irc"
class IrcBot extends Robot
send: (user, strings...) ->
for str in strings
- 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)
+ 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
- do (str) ->
- @send user, "#{user.name}: #{str}"
+ @send user, "#{user.name}: #{str}"
join: (channel) ->
self = @
@@ -60,8 +58,7 @@ 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
- do (room) ->
- @join room
+ @join room
bot.addListener 'message', (from, to, message) ->
console.log "From #{from} to #{to}: #{message}"

0 comments on commit 23cd931

Please sign in to comment.