mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
* closes #6738 closes #6290 * fix test, delete keys * delete all bans on user delete * fix upgrade script to actually read reason
This commit is contained in:
committed by
GitHub
parent
630873a742
commit
95501e8fee
@@ -119,6 +119,7 @@ module.exports = function (User) {
|
||||
'users:postcount',
|
||||
'users:reputation',
|
||||
'users:banned',
|
||||
'users:banned:expire',
|
||||
'users:online',
|
||||
'users:notvalidated',
|
||||
'digest:day:uids',
|
||||
@@ -149,6 +150,9 @@ module.exports = function (User) {
|
||||
function (next) {
|
||||
deleteUserIps(uid, next);
|
||||
},
|
||||
function (next) {
|
||||
deleteBans(uid, next);
|
||||
},
|
||||
function (next) {
|
||||
deleteUserFromFollowers(uid, next);
|
||||
},
|
||||
@@ -220,6 +224,20 @@ module.exports = function (User) {
|
||||
], callback);
|
||||
}
|
||||
|
||||
function deleteBans(uid, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
db.getSortedSetRange('uid:' + uid + ':bans:timestamp', 0, -1, next);
|
||||
},
|
||||
function (bans, next) {
|
||||
db.deleteAll(bans, next);
|
||||
},
|
||||
function (next) {
|
||||
db.delete('uid:' + uid + ':bans:timestamp', next);
|
||||
},
|
||||
], callback);
|
||||
}
|
||||
|
||||
function deleteUserFromFollowers(uid, callback) {
|
||||
async.parallel({
|
||||
followers: async.apply(db.getSortedSetRange, 'followers:' + uid, 0, -1),
|
||||
|
||||
Reference in New Issue
Block a user