From efe54b5e351da9711ef1a9240f9129c8030eb044 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 21 Jun 2013 18:11:22 +0000 Subject: [PATCH] event.rUser contains resolved user object from users module [#507] --- modules/users/users.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/users/users.js b/modules/users/users.js index 4d372ef..b96ea2b 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -142,6 +142,15 @@ var users = function(dbot) { this.on = ['JOIN', 'NICK']; this.onLoad = function() { + dbot.instance.addPreEmitHook(function(event, callback) { + if(event.user) { + this.api.resolveUser(event.server, event.user, function(user) { + event.rUser = user; + callback(false); + }); + } + }.bind(this)); + dbot.instance.addListener('366', 'users', function(event) { this.api.getChannel(event.server, event.channel.name, function(channel) { var checkChannelUsers = function(channel) {