feat: update unban logic/invocation and refactor User.bans module

* auto unban when User.getUsersFields is called and the user is banned but has expired

* cleanups and removal of expiry_readable

* expiry_readable make an alias for backward compatibility

* User.bans.func vs User.*ban*Func

* console.log cleanups, plus todo message added

* use code util.deprecate

* fix: remove ununsed winston require
This commit is contained in:
Aziz Khoury
2019-04-05 21:14:49 +03:00
committed by Julian Lam
parent ed91d3f2c8
commit 3fbb6faf28
11 changed files with 115 additions and 68 deletions

View File

@@ -79,7 +79,7 @@ Digest.getSubscribers = function (interval, callback) {
},
function (subscribers, next) {
async.filter(subscribers, function (uid, next) {
user.isBanned(uid, function (err, banned) {
user.bans.isBanned(uid, function (err, banned) {
next(err, !banned);
});
}, next);