From ac9488bad9ec6b984f096b8e2a8c48b3b66831ce Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 28 Jan 2016 17:36:19 +0000 Subject: [PATCH] offlineReporting configurable --- modules/report/api.js | 2 ++ modules/report/config.json | 3 ++- modules/report/report.js | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/report/api.js b/modules/report/api.js index 07922e7..cbdae3e 100644 --- a/modules/report/api.js +++ b/modules/report/api.js @@ -70,6 +70,7 @@ console.log('removing ' + uPart); }); }, function() { // Queue notifies for offline ops + if(this.config.offlineReporting == true) { if(!_.include(this.config.noMissingChans, cName)) { _.each(offlineOps, function(op) { if(!this.pending[op.id]) this.pending[op.id] = []; @@ -82,6 +83,7 @@ console.log('removing ' + uPart); this.pNotify[op.id] = true; }, this); } + } // Send notifies to online ops ops = _.difference(ops, _.keys(offlineOps)); diff --git a/modules/report/config.json b/modules/report/config.json index ee35fee..a8a6087 100644 --- a/modules/report/config.json +++ b/modules/report/config.json @@ -26,5 +26,6 @@ "host_lookup": [ "#chan" ], - "noMissingChans": [] + "noMissingChans": [], + "offlineReporting": false } diff --git a/modules/report/report.js b/modules/report/report.js index 0dd57fc..a960343 100644 --- a/modules/report/report.js +++ b/modules/report/report.js @@ -10,7 +10,6 @@ var report = function(dbot) { this.internalAPI = { 'notify': function(server, users, message) { async.eachSeries(users, function(nick, next) { -console.log('sending msg to ' + nick); setTimeout(function() { dbot.say(server, nick, message); next();