Skip to content

Commit

Permalink
Fix for the depreciation of userForId()
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcody committed Jun 14, 2013
1 parent 1ebd702 commit c269660
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 c269660

Please sign in to comment.