From 447bcbabf8d0ed0e82de5f052c562082cb199c4f Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 24 Jan 2013 19:29:13 +0000 Subject: [PATCH] users emit for new users --- modules/users/README.md | 3 +++ modules/users/users.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/modules/users/README.md b/modules/users/README.md index 34195c4..0a11e5b 100644 --- a/modules/users/README.md +++ b/modules/users/README.md @@ -51,3 +51,6 @@ Return whether a user is online in a given channel on the given server. #### nick_changed(server, newNick) This is executed when a new alias is added for a user. + +#### new_user(server, nick) +This is executed when a new primary user is added to the known users DB. diff --git a/modules/users/users.js b/modules/users/users.js index 8e934b7..205eb76 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -48,6 +48,7 @@ var users = function(dbot) { nick = this.api.resolveUser(event.server, nick); } else { knownUsers.users.push(nick); + dbot.api.emit('new_user', [ event.server, nick ]); } if(!_.include(channelUsers, nick)) { @@ -78,6 +79,7 @@ var users = function(dbot) { nick = this.api.resolveUser(event.server, nick); } else { knownUsers.users.push(nick); + dbot.api.emit('new_user', [ event.server, nick ]); } if(!_.include(channelUsers, nick)) { channelUsers.push(nick);