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 winston = require('winston');
|
||||
var nconf = require('nconf');
|
||||
var validator = require('validator');
|
||||
|
||||
var websockets = require('./index');
|
||||
var user = require('../user');
|
||||
@@ -16,13 +15,12 @@ var plugins = require('../plugins');
|
||||
var SocketHelpers = {};
|
||||
|
||||
SocketHelpers.notifyOnlineUsers = function(uid, result) {
|
||||
var cid = result.posts[0].topic.cid;
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
user.getUidsFromSet('users:online', 0, -1, 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) {
|
||||
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) {
|
||||
var tid = data.tid,
|
||||
uid = data.uid,
|
||||
content = data.content,
|
||||
postData;
|
||||
|
||||
var tid = data.tid;
|
||||
var uid = data.uid;
|
||||
var content = data.content;
|
||||
var postData;
|
||||
var cid;
|
||||
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
Topics.getTopicField(tid, 'cid', next);
|
||||
|
||||
Reference in New Issue
Block a user