From b8c8ae09988995e8f9f14b3ba5fcee481d395ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 22 Feb 2025 16:56:13 -0500 Subject: [PATCH] fix: #13194, dont notify about cid=-1 --- src/socket.io/helpers.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/socket.io/helpers.js b/src/socket.io/helpers.js index 66e568d1b2..d80638458e 100644 --- a/src/socket.io/helpers.js +++ b/src/socket.io/helpers.js @@ -17,6 +17,10 @@ const batch = require('../batch'); const SocketHelpers = module.exports; SocketHelpers.notifyNew = async function (uid, type, result) { + const post = result.posts[0]; + if (post && post.topic && parseInt(post.topic.cid, 10) === -1) { + return; + } let uids = await user.getUidsFromSet('users:online', 0, -1); uids = uids.filter(toUid => parseInt(toUid, 10) !== uid); await batch.processArray(uids, async (uids) => {