mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
filter topics you cant read @benlubar
This commit is contained in:
@@ -205,10 +205,11 @@ module.exports = function (Topics) {
|
|||||||
},
|
},
|
||||||
function (results, next) {
|
function (results, next) {
|
||||||
cid = cid && cid.map(String);
|
cid = cid && cid.map(String);
|
||||||
|
results.readableCids = results.readableCids.map(String);
|
||||||
|
|
||||||
topicData.forEach(function (topic, index) {
|
topicData.forEach(function (topic, index) {
|
||||||
function cidMatch(topicCid) {
|
function cidMatch(topicCid) {
|
||||||
return (!cid || (cid.length && cid.includes(String(topicCid))));
|
return (!cid || (cid.length && cid.includes(String(topicCid)))) && results.readableCids.includes(String(topicCid));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (topic && topic.cid && cidMatch(topic.cid) && !blockedUids.includes(parseInt(topic.uid, 10))) {
|
if (topic && topic.cid && cidMatch(topic.cid) && !blockedUids.includes(parseInt(topic.uid, 10))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user