mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
@@ -271,7 +271,15 @@ var async = require('async'),
|
||||
};
|
||||
|
||||
Groups.getGroupFields = function(groupName, fields, callback) {
|
||||
db.getObjectFields('group:' + groupName, fields, callback);
|
||||
Groups.getMultipleGroupFields([groupName], fields, function(err, groups) {
|
||||
callback(err, groups ? groups[0] : null);
|
||||
});
|
||||
};
|
||||
|
||||
Groups.getMultipleGroupFields = function(groups, fields, callback) {
|
||||
db.getObjectsFields(groups.map(function(group) {
|
||||
return 'group:' + group;
|
||||
}), fields, callback);
|
||||
};
|
||||
|
||||
Groups.setGroupField = function(groupName, field, value, callback) {
|
||||
@@ -306,6 +314,12 @@ var async = require('async'),
|
||||
db.getSortedSetRevRange('group:' + groupName + ':members', start, end, callback);
|
||||
};
|
||||
|
||||
Groups.getMembersOfGroups = function(groupNames, callback) {
|
||||
db.getSortedSetsMembers(groupNames.map(function(name) {
|
||||
return 'group:' + name + ':members';
|
||||
}), callback);
|
||||
};
|
||||
|
||||
Groups.isMember = function(uid, groupName, callback) {
|
||||
if (!uid || parseInt(uid, 10) <= 0) {
|
||||
return callback(null, false);
|
||||
|
||||
Reference in New Issue
Block a user