fixed group hide for privilege groups

This commit is contained in:
barisusakli
2014-06-14 18:26:16 -04:00
parent 1908f7b57a
commit ab80016910
2 changed files with 9 additions and 7 deletions

View File

@@ -235,7 +235,8 @@
userTitle: values.userTitle,
description: values.description,
icon: values.icon || '',
labelColor: values.labelColor || '#000000'
labelColor: values.labelColor || '#000000',
hidden: values.hidden || '0'
}, callback);
});
};
@@ -265,7 +266,6 @@
return callback(err);
}
Groups.hide(groupName);
db.setAdd('group:' + groupName + ':members', uid, callback);
});
}

View File

@@ -96,11 +96,13 @@ Categories.setGroupPrivilege = function(socket, data, callback) {
return callback(new Error('[[error:invalid-data]]'));
}
if (data.set) {
groups.join('cid:' + data.cid + ':privileges:' + data.privilege, data.name, callback);
} else {
groups.leave('cid:' + data.cid + ':privileges:' + data.privilege, data.name, callback);
groups[data.set ? 'join' : 'leave']('cid:' + data.cid + ':privileges:' + data.privilege, data.name, function (err) {
if (err) {
return callback(err);
}
groups.hide('cid:' + data.cid + ':privileges:' + data.privilege, callback);
});
};
Categories.groupsList = function(socket, cid, callback) {