Skip to content

Node.js based forum software built for the modern web

fix: #13194, dont notify about cid=-1

Barış Soner Uşaklıb8c8ae099889
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) => {