From f24a1a34ceee57bdf28f04add94528caabeafa8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 3 May 2024 11:27:52 -0400 Subject: [PATCH] dont show tags from cid -1 --- src/socket.io/topics/tags.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/socket.io/topics/tags.js b/src/socket.io/topics/tags.js index a8f86eee19..c5d2695692 100644 --- a/src/socket.io/topics/tags.js +++ b/src/socket.io/topics/tags.js @@ -68,6 +68,7 @@ module.exports = function (SocketTopics) { } } data.cids = await categories.getCidsByPrivilege('categories:cid', uid, 'topics:read'); + data.cids = data.cids.filter(cid => cid !== -1); return await method(data); } @@ -106,7 +107,8 @@ module.exports = function (SocketTopics) { const start = parseInt(data.after, 10); const stop = start + 99; - const cids = await categories.getCidsByPrivilege('categories:cid', socket.uid, 'topics:read'); + let cids = await categories.getCidsByPrivilege('categories:cid', socket.uid, 'topics:read'); + cids = cids.filter(cid => cid !== -1); const tags = await topics.getCategoryTagsData(cids, start, stop); return { tags: tags.filter(Boolean), nextStart: stop + 1 }; };