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

This commit is contained in:
Barış Soner Uşaklı
2025-02-22 16:56:13 -05:00
parent fe980688e4
commit b8c8ae0998

View File

@@ -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) => {