From 0e5cfa56fb6216e7e73882e4f9c7cea95e4283fb Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 5 Aug 2013 19:01:33 +0000 Subject: [PATCH] create resolveUsers and user in users listener, changed logic and automatic channel record creation in jsbot preEmit hook [#537] --- modules/users/api.js | 21 ++++++++++++++ modules/users/config.json | 2 +- modules/users/users.js | 58 +++++++++++++++++++-------------------- 3 files changed, 50 insertions(+), 31 deletions(-) diff --git a/modules/users/api.js b/modules/users/api.js index 8fc537a..ec97930 100644 --- a/modules/users/api.js +++ b/modules/users/api.js @@ -25,6 +25,27 @@ var api = function(dbot) { }); }, + // Return many user records given primary nicks of aliases + 'resolveUsers': function(server, nicks, callback) { + var users = []; + this.db.search('users', { 'server': server }, function(result) { + var pNicks = result.aliases.slice(0).unshift(result.primaryNick); + for(var i=0;i