This commit is contained in:
Barış Soner Uşaklı
2018-12-01 16:58:52 -05:00
parent cb7c2d8c28
commit 8d7c3897f2

View File

@@ -13,10 +13,10 @@ module.exports = function (Groups) {
}
query = query.toLowerCase();
async.waterfall([
async.apply(db.getObjectValues, 'groupslug:groupname'),
async.apply(db.getSortedSetRange, 'groups:createtime', 0, -1),
function (groupNames, next) {
// Ephemeral groups and the registered-users groups are searchable
groupNames = Groups.ephemeralGroups.concat(groupNames).concat('registered-users');
groupNames = Groups.ephemeralGroups.concat(groupNames);
groupNames = groupNames.filter(function (name) {
return name.toLowerCase().includes(query) && name !== 'administrators' && !Groups.isPrivilegeGroup(name);
});