mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
getUsersInCategory
This commit is contained in:
@@ -5,6 +5,7 @@ var async = require('async'),
|
||||
categories = require('../categories'),
|
||||
privileges = require('../privileges'),
|
||||
user = require('../user'),
|
||||
websockets = require('./index'),
|
||||
|
||||
SocketCategories = {};
|
||||
|
||||
@@ -73,4 +74,9 @@ SocketCategories.lastTopicIndex = function(socket, cid, callback) {
|
||||
db.sortedSetCard('categories:' + cid + ':tid', callback);
|
||||
};
|
||||
|
||||
SocketCategories.getUsersInCategory = function(socket, cid, callback) {
|
||||
var uids = websockets.getUidsInRoom('category_' + cid);
|
||||
user.getMultipleUserFields(uids, ['uid', 'userslug', 'username', 'picture'], callback);
|
||||
};
|
||||
|
||||
module.exports = SocketCategories;
|
||||
|
||||
Reference in New Issue
Block a user