diff --git a/src/socket.io/helpers.js b/src/socket.io/helpers.js index 789ec1660a..3aeaaf0bf3 100644 --- a/src/socket.io/helpers.js +++ b/src/socket.io/helpers.js @@ -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); diff --git a/src/topics/create.js b/src/topics/create.js index 5c8698dbe1..931e862b13 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -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);