Skip to content

Commit

Permalink
Handle PMs once, rather than twice.
Browse files Browse the repository at this point in the history
Currently new PMs are handled first by the 'message' handler and then by the
'pm' handler.  This change makes the 'message' handler take a back seat to the
'pm' handler.
  • Loading branch information
hashbrowncipher committed Feb 15, 2013
1 parent e5accaa commit 6b03654
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ class IrcBot extends Adapter
self.createUser channel, nick

bot.addListener 'message', (from, to, message) ->
if options.nick.toLowerCase() == to.toLowerCase()
# this is a private message, let the 'pm' listener handle it
return

console.log "From #{from} to #{to}: #{message}"

user = self.createUser to, from
Expand Down

0 comments on commit 6b03654

Please sign in to comment.