This commit is contained in:
reality 2014-07-07 11:06:38 +00:00
parent f621fbc38e
commit 01b2d22059
3 changed files with 11 additions and 2 deletions

2
jsbot

@ -1 +1 @@
Subproject commit c8bfa1bd838d8ff074c266055e373e63506e647b
Subproject commit 14868e9d935bfd39ba698f6c610fc0c049da2b8a

View File

@ -68,6 +68,10 @@ var api = function(dbot) {
},
'resolveChannel': function(server, channelName, callback) {
if(_.has(this.chanCache[server], channelName)) {
return this.api.getChannel(this.chanCache[server][channelName], callback);
}
var channel = false;
this.db.search('channel_users', {
'server': server,
@ -76,9 +80,10 @@ var api = function(dbot) {
channel = result;
}, function(err) {
if(!err) {
this.chanCache[server][channelName] = channel.id;
callback(channel);
}
});
}.bind(this));
},
'getChannel': function(uuid, callback) {

View File

@ -11,6 +11,10 @@ var users = function(dbot) {
_.each(dbot.config.servers, function(v, k) {
this.userCache[k] = {};
}.bind(this));
this.chanCache = {};
_.each(dbot.config.servers, function(v, k) {
this.chanCache[k] = {};
}.bind(this));
/*** Internal API ***/
this.internalAPI = {