Skip to content

Node.js based forum software built for the modern web

group cleanup

barisusaklib92f455cc1db
diff --git a/src/groups.js b/src/groups.js
index bd6e122d33..0c3319d8c6 100644
--- a/src/groups.js
+++ b/src/groups.js
@@ -255,7 +255,7 @@ var utils = require('../public/src/utils');
return callback(new Error('[[error:no-group]]'));
}
- Groups.get.call(Groups, groupName, options, callback);
+ Groups.get(groupName, options, callback);
});
};
@@ -287,23 +287,21 @@ var utils = require('../public/src/utils');
Groups.isPrivate = function(groupName, callback) {
db.getObjectField('group:' + groupName, 'private', function(err, isPrivate) {
- isPrivate = isPrivate || isPrivate === null;
-
- if (typeof isPrivate === 'string') {
- isPrivate = (isPrivate === '0' ? false : true);
+ if (err) {
+ return callback(err);
}
- callback(err, isPrivate); // Private, if not set at all
+ callback(null, (parseInt(isPrivate, 10) === 0) ? false : true);
});
};
Groups.isHidden = function(groupName, callback) {
- Groups.getGroupFields(groupName, ['hidden'], function(err, values) {
+ db.getObjectField(groupName, 'hidden', function(err, isHidden) {
if (err) {
return callback(err);
}
- callback(null, parseInt(values.hidden, 10) === 1);
+ callback(null, parseInt(isHidden, 10) === 1);
});
};