Merge branch 'master' into develop

This commit is contained in:
Julian Lam
2017-02-24 12:46:40 -05:00
449 changed files with 9202 additions and 6984 deletions

View File

@@ -9,7 +9,6 @@ var groups = require('../groups');
var privileges = require('../privileges');
module.exports = function (Categories) {
Categories.purge = function (cid, uid, callback) {
async.waterfall([
function (next) {
@@ -17,7 +16,7 @@ module.exports = function (Categories) {
async.eachLimit(tids, 10, function (tid, next) {
topics.purgePostsAndTopic(tid, uid, next);
}, next);
}, {alwaysStartAt: 0}, next);
}, { alwaysStartAt: 0 }, next);
},
function (next) {
Categories.getPinnedTids('cid:' + cid + ':tids:pinned', 0, -1, next);
@@ -33,7 +32,7 @@ module.exports = function (Categories) {
function (next) {
plugins.fireHook('action:category.delete', {cid: cid, uid: uid});
next();
}
},
], callback);
};
@@ -55,14 +54,14 @@ module.exports = function (Categories) {
'cid:' + cid + ':ignorers',
'cid:' + cid + ':children',
'cid:' + cid + ':tag:whitelist',
'category:' + cid
'category:' + cid,
], next);
},
function (next) {
async.each(privileges.privilegeList, function (privilege, next) {
groups.destroy('cid:' + cid + ':privileges:' + privilege, next);
}, next);
}
},
], function (err) {
callback(err);
});
@@ -77,7 +76,7 @@ module.exports = function (Categories) {
},
children: function (next) {
db.getSortedSetRange('cid:' + cid + ':children', 0, -1, next);
}
},
}, next);
},
function (results, next) {
@@ -94,14 +93,14 @@ module.exports = function (Categories) {
},
function (next) {
db.sortedSetAdd('cid:0:children', cid, cid, next);
}
},
], next);
}, next);
}
},
], next);
}
},
], function (err) {
callback(err);
});
}
};
};