mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
closes #4236
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
var validator = require('validator');
|
|
||||||
|
|
||||||
var websockets = require('./index');
|
var websockets = require('./index');
|
||||||
var user = require('../user');
|
var user = require('../user');
|
||||||
@@ -16,13 +15,12 @@ var plugins = require('../plugins');
|
|||||||
var SocketHelpers = {};
|
var SocketHelpers = {};
|
||||||
|
|
||||||
SocketHelpers.notifyOnlineUsers = function(uid, result) {
|
SocketHelpers.notifyOnlineUsers = function(uid, result) {
|
||||||
var cid = result.posts[0].topic.cid;
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function(next) {
|
function(next) {
|
||||||
user.getUidsFromSet('users:online', 0, -1, next);
|
user.getUidsFromSet('users:online', 0, -1, next);
|
||||||
},
|
},
|
||||||
function(uids, next) {
|
function(uids, next) {
|
||||||
privileges.categories.filterUids('read', cid, uids, next);
|
privileges.topics.filterUids('read', result.posts[0].topic.tid, uids, next);
|
||||||
},
|
},
|
||||||
function(uids, next) {
|
function(uids, next) {
|
||||||
plugins.fireHook('filter:sockets.sendNewPostToUids', {uidsTo: uids, uidFrom: uid, type: 'newPost'}, next);
|
plugins.fireHook('filter:sockets.sendNewPostToUids', {uidsTo: uids, uidFrom: uid, type: 'newPost'}, next);
|
||||||
|
|||||||
@@ -186,12 +186,12 @@ module.exports = function(Topics) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Topics.reply = function(data, callback) {
|
Topics.reply = function(data, callback) {
|
||||||
var tid = data.tid,
|
var tid = data.tid;
|
||||||
uid = data.uid,
|
var uid = data.uid;
|
||||||
content = data.content,
|
var content = data.content;
|
||||||
postData;
|
var postData;
|
||||||
|
|
||||||
var cid;
|
var cid;
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function(next) {
|
function(next) {
|
||||||
Topics.getTopicField(tid, 'cid', next);
|
Topics.getTopicField(tid, 'cid', next);
|
||||||
|
|||||||
Reference in New Issue
Block a user