mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 01:45:47 +01:00
remove parseInts
This commit is contained in:
@@ -7,7 +7,7 @@ module.exports = function (Messaging) {
|
||||
async.waterfall([
|
||||
async.apply(Messaging.getMessageField, mid, 'deleted'),
|
||||
function (deleted, next) {
|
||||
if (parseInt(deleted, 10)) {
|
||||
if (deleted) {
|
||||
return next(new Error('[[error:chat-deleted-already]]'));
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = function (Messaging) {
|
||||
async.waterfall([
|
||||
async.apply(Messaging.getMessageField, mid, 'deleted'),
|
||||
function (deleted, next) {
|
||||
if (!parseInt(deleted, 10)) {
|
||||
if (!deleted) {
|
||||
return next(new Error('[[error:chat-restored-already]]'));
|
||||
}
|
||||
|
||||
|
||||
@@ -268,11 +268,11 @@ Messaging.canMessageUser = function (uid, toUid, callback) {
|
||||
user.getUserFields(uid, ['banned', 'email:confirmed'], next);
|
||||
},
|
||||
function (userData, next) {
|
||||
if (parseInt(userData.banned, 10) === 1) {
|
||||
if (userData.banned) {
|
||||
return callback(new Error('[[error:user-banned]]'));
|
||||
}
|
||||
|
||||
if (meta.config.requireEmailConfirmation && parseInt(userData['email:confirmed'], 10) !== 1) {
|
||||
if (meta.config.requireEmailConfirmation && !userData['email:confirmed']) {
|
||||
return callback(new Error('[[error:email-not-confirmed-chat]]'));
|
||||
}
|
||||
|
||||
@@ -322,11 +322,11 @@ Messaging.canMessageRoom = function (uid, roomId, callback) {
|
||||
user.getUserFields(uid, ['banned', 'email:confirmed'], next);
|
||||
},
|
||||
function (userData, next) {
|
||||
if (parseInt(userData.banned, 10) === 1) {
|
||||
if (userData.banned) {
|
||||
return next(new Error('[[error:user-banned]]'));
|
||||
}
|
||||
|
||||
if (meta.config.requireEmailConfirmation && parseInt(userData['email:confirmed'], 10) !== 1) {
|
||||
if (meta.config.requireEmailConfirmation && !userData['email:confirmed']) {
|
||||
return next(new Error('[[error:email-not-confirmed-chat]]'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user