From 7c31d5bbe81b84e322da02b4a0dac450af20eea5 Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 30 Apr 2013 14:04:21 +0000 Subject: [PATCH] Remove a bunch of useless users API functions, finish documentation [#352] --- modules/users/README.md | 5 +++++ modules/users/api.js | 43 ----------------------------------------- 2 files changed, 5 insertions(+), 43 deletions(-) diff --git a/modules/users/README.md b/modules/users/README.md index ee157de..032d7cd 100644 --- a/modules/users/README.md +++ b/modules/users/README.md @@ -50,6 +50,11 @@ channel was found from the given parameters. Get a list of all users the bot currently knows about. Callback is called with one argument, a list of user records. +#### isOnline +Is the given nick on the given server currently in the given channel. Callback +is called with one argument, a boolean as to whether the nick is currently in +the specified place. + ### Data #### User Object diff --git a/modules/users/api.js b/modules/users/api.js index 830dd39..53f3727 100644 --- a/modules/users/api.js +++ b/modules/users/api.js @@ -79,42 +79,6 @@ var api = function(dbot) { }); }, - 'isKnownUser': function(server, nick, callback) { - this.api.resolveUser(server, nick, function(isKnown) { - if(isKnown == false) { - callback(false); - } else { - callback(true); - } - }); - }, - - 'isPrimaryUser': function(server, nick, callback) { - var isPrimaryUser = false; - this.db.search('users', { - 'server': server, - 'primaryNick': nick - }, function(user) { - isPrimaryUser = true; - }, function(err) { - if(!err) { - callback(isPrimaryUser); - } - }); - }, - - 'getAliases': function(server, nick, callback) { - var aliases; - this.db.search('users', { - 'server': server, - 'primaryNick': nick - }, function(result) { - aliases = result.aliases; - }, function(err) { - callback(aliases); - }); - }, - 'isOnline': function(server, nick, channel, callback) { this.api.resolveUser(server, nick, function(user) { var possiNicks = [user].concat(user.aliases); @@ -129,13 +93,6 @@ var api = function(dbot) { callback(isOnline); } }); - }, - - 'isChannelUser': function(server, nick, channel, callback) { - this.api.resolveUser(server, nick, function(user) { - var isChannelUser = _.include(user.channels, channel); - callback(isChannelUser); - }); } };