mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
closes #6005
This commit is contained in:
@@ -75,6 +75,10 @@ module.exports = function (Topics) {
|
||||
|
||||
var cutoff = params.cutoff || Topics.unreadCutoff();
|
||||
|
||||
if (params.cid && !Array.isArray(params.cid)) {
|
||||
params.cid = [params.cid];
|
||||
}
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
async.parallel({
|
||||
@@ -181,10 +185,11 @@ module.exports = function (Topics) {
|
||||
},
|
||||
function (results, next) {
|
||||
var topics = results.topics;
|
||||
cid = cid && cid.map(String);
|
||||
tids = topics.filter(function (topic, index) {
|
||||
return topic && topic.cid &&
|
||||
(!!results.isTopicsFollowed[index] || results.ignoredCids.indexOf(topic.cid.toString()) === -1) &&
|
||||
(!cid || parseInt(cid, 10) === parseInt(topic.cid, 10));
|
||||
(!cid || (cid.length && cid.indexOf(String(topic.cid)) !== -1));
|
||||
}).map(function (topic) {
|
||||
return topic.tid;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user