offlineReporting configurable

This commit is contained in:
reality 2016-01-28 17:36:19 +00:00
parent 3af2cbb678
commit ac9488bad9
3 changed files with 4 additions and 2 deletions

View File

@ -70,6 +70,7 @@ console.log('removing ' + uPart);
}); });
}, function() { }, function() {
// Queue notifies for offline ops // Queue notifies for offline ops
if(this.config.offlineReporting == true) {
if(!_.include(this.config.noMissingChans, cName)) { if(!_.include(this.config.noMissingChans, cName)) {
_.each(offlineOps, function(op) { _.each(offlineOps, function(op) {
if(!this.pending[op.id]) this.pending[op.id] = []; if(!this.pending[op.id]) this.pending[op.id] = [];
@ -82,6 +83,7 @@ console.log('removing ' + uPart);
this.pNotify[op.id] = true; this.pNotify[op.id] = true;
}, this); }, this);
} }
}
// Send notifies to online ops // Send notifies to online ops
ops = _.difference(ops, _.keys(offlineOps)); ops = _.difference(ops, _.keys(offlineOps));

View File

@ -26,5 +26,6 @@
"host_lookup": [ "host_lookup": [
"#chan" "#chan"
], ],
"noMissingChans": [] "noMissingChans": [],
"offlineReporting": false
} }

View File

@ -10,7 +10,6 @@ var report = function(dbot) {
this.internalAPI = { this.internalAPI = {
'notify': function(server, users, message) { 'notify': function(server, users, message) {
async.eachSeries(users, function(nick, next) { async.eachSeries(users, function(nick, next) {
console.log('sending msg to ' + nick);
setTimeout(function() { setTimeout(function() {
dbot.say(server, nick, message); dbot.say(server, nick, message);
next(); next();