mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: #13194, dont notify about cid=-1
This commit is contained in:
@@ -17,6 +17,10 @@ const batch = require('../batch');
|
|||||||
const SocketHelpers = module.exports;
|
const SocketHelpers = module.exports;
|
||||||
|
|
||||||
SocketHelpers.notifyNew = async function (uid, type, result) {
|
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);
|
let uids = await user.getUidsFromSet('users:online', 0, -1);
|
||||||
uids = uids.filter(toUid => parseInt(toUid, 10) !== uid);
|
uids = uids.filter(toUid => parseInt(toUid, 10) !== uid);
|
||||||
await batch.processArray(uids, async (uids) => {
|
await batch.processArray(uids, async (uids) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user