mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 10:16:12 +01:00
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:
@@ -55,7 +55,7 @@ module.exports = function (SocketUser) {
|
||||
toggleBan(socket.uid, uids, function (uid, next) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
user.unban(uid, next);
|
||||
user.bans.unban(uid, next);
|
||||
},
|
||||
function (next) {
|
||||
events.log({
|
||||
@@ -124,7 +124,7 @@ module.exports = function (SocketUser) {
|
||||
});
|
||||
},
|
||||
function (next) {
|
||||
user.ban(uid, until, reason, next);
|
||||
user.bans.ban(uid, until, reason, next);
|
||||
},
|
||||
function (banData, next) {
|
||||
db.setObjectField('uid:' + uid + ':ban:' + banData.timestamp, 'fromUid', callerUid, next);
|
||||
|
||||
Reference in New Issue
Block a user