@ -35,6 +35,10 @@ Groups.leave = function(socket, data, callback) {
return callback(new Error('[[error:invalid-data]]'));
}
if (socket.uid === parseInt(data.uid, 10) && data.groupName === 'administrators') {
return callback(new Error('[[error:cant-remove-self-as-admin]]'));
groups.leave(data.groupName, data.uid, callback);
};