From 45acf809871ae1f2e26a2c24edfc2953611b4750 Mon Sep 17 00:00:00 2001 From: Aziz Khoury Date: Fri, 19 Apr 2019 00:22:33 +0300 Subject: [PATCH] remove expire timestamp when banning user permanently, fixes #7547 (#7548) --- src/user/bans.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/user/bans.js b/src/user/bans.js index 5832dfea59..6de515b426 100644 --- a/src/user/bans.js +++ b/src/user/bans.js @@ -45,6 +45,9 @@ module.exports = function (User) { if (until > now) { tasks.push(async.apply(db.sortedSetAdd, 'users:banned:expire', until, uid)); tasks.push(async.apply(User.setUserField, uid, 'banned:expire', until)); + } else { + tasks.push(async.apply(db.sortedSetRemove, 'users:banned:expire', uid)); + tasks.push(async.apply(User.setUserField, uid, 'banned:expire', 0)); } async.series(tasks, function (err) {