Skip to content

Commit

Permalink
Merge pull request nandub#98 from 5thWall/bug/joinpart
Browse files Browse the repository at this point in the history
Pass user to Leave and Enter Message constructors
  • Loading branch information
jgable committed Nov 15, 2013
2 parents f5b5496 + 637effc commit 276f1df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ class IrcBot extends Adapter
@bot.join channel, () ->
console.log('joined %s', channel)

self.receive new EnterMessage(null)
selfUser = self.getUserFromName self.robot.name
self.receive new EnterMessage(selfUser)

part: (channel) ->
self = @
@bot.part channel, () ->
console.log('left %s', channel)

self.receive new LeaveMessage(null)
selfUser = self.getUserFromName self.robot.name
self.receive new LeaveMessage(selfUser)

getUserFromName: (name) ->
return @robot.brain.userForName(name) if @robot.brain?.userForName?
Expand Down

0 comments on commit 276f1df

Please sign in to comment.