Skip to content

Commit

Permalink
Merge pull request nandub#82 from torp/Fix-userForId
Browse files Browse the repository at this point in the history
Fix for the deprecation of `userForId()`
  • Loading branch information
jgable committed Jun 14, 2013
2 parents 1ebd702 + c269660 commit 64b36a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,16 @@ class IrcBot extends Adapter

return @userForName name

getUserFromId: (id) ->
return @robot.brain.userForId(id) if @robot.brain?.userForId?

return @userForId id

createUser: (channel, from) ->
user = @getUserFromName from
unless user?
id = new Date().getTime().toString()
user = @userForId id
user = @getUserForId id
user.name = from

if channel.match(/^[&#]/)
Expand Down

0 comments on commit 64b36a0

Please sign in to comment.