Add hook `filter:topics.getUnreadTids`

Allows for filtering topics from unread count and unread page
v1.18.x
Peter Jaszkowiak 8 years ago
parent 22db07938c
commit 6b05f6c5e9

@ -10,6 +10,7 @@ var categories = require('../categories');
var privileges = require('../privileges'); var privileges = require('../privileges');
var meta = require('../meta'); var meta = require('../meta');
var utils = require('../utils'); var utils = require('../utils');
var plugins = require('../plugins');
module.exports = function (Topics) { module.exports = function (Topics) {
Topics.getTotalUnread = function (uid, filter, callback) { Topics.getTotalUnread = function (uid, filter, callback) {
@ -132,6 +133,17 @@ module.exports = function (Topics) {
filterTopics(uid, tids, params.cid, params.filter, next); filterTopics(uid, tids, params.cid, params.filter, next);
}, },
function (tids, next) {
plugins.fireHook('filter:topics.getUnreadTids', {
uid: uid,
tids: tids,
cid: params.cid,
filter: params.filter,
}, next);
},
function (results, next) {
next(null, results.tids);
},
], callback); ], callback);
}; };

Loading…
Cancel
Save