From 12601dd3aaa9a5e0e9842131cb4d9f48621caa33 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 22 Jul 2015 15:06:30 -0400 Subject: [PATCH] added new hook "filter:digest.subscribers" to allow plugins to override digest subscriptions --- src/user/digest.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/user/digest.js b/src/user/digest.js index 056eebd508..c1656d45c8 100644 --- a/src/user/digest.js +++ b/src/user/digest.js @@ -64,7 +64,14 @@ var async = require('async'), }; Digest.getSubscribers = function(interval, callback) { - db.getSortedSetRange('digest:' + interval + ':uids', 0, -1, callback); + db.getSortedSetRange('digest:' + interval + ':uids', 0, -1, function(err, subscribers) { + plugins.fireHook('filter:digest.subscribers', { + interval: interval, + subscribers: subscribers + }, function(err, returnData) { + callback(err, returnData.subscribers); + }); + }); }; Digest.send = function(data, callback) {