From 6b05f6c5e93f31259cecc7c63987e677ba54c1df Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Sat, 13 May 2017 18:46:11 -0600
Subject: [PATCH] Add hook `filter:topics.getUnreadTids`
Allows for filtering topics from unread count and unread page
---
src/topics/unread.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/topics/unread.js b/src/topics/unread.js
index ef2f35f22c..ac26a277f9 100644
--- a/src/topics/unread.js
+++ b/src/topics/unread.js
@@ -10,6 +10,7 @@ var categories = require('../categories');
var privileges = require('../privileges');
var meta = require('../meta');
var utils = require('../utils');
+var plugins = require('../plugins');
module.exports = function (Topics) {
Topics.getTotalUnread = function (uid, filter, callback) {
@@ -132,6 +133,17 @@ module.exports = function (Topics) {
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);
};