mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	closes #2401
This commit is contained in:
		| @@ -141,15 +141,19 @@ SocketModules.chats.send = function(socket, data, callback) { | ||||
|  | ||||
| 	socket.lastChatMessageTime = now; | ||||
|  | ||||
| 	user.getUserField(socket.uid, 'banned', function(err, banned) { | ||||
| 	user.getUserFields(socket.uid, ['banned', 'email:confirmed'], function(err, userData) { | ||||
| 		if (err) { | ||||
| 			return callback(err); | ||||
| 		} | ||||
|  | ||||
| 		if (parseInt(banned, 10) === 1) { | ||||
| 		if (parseInt(userData.banned, 10) === 1) { | ||||
| 			return callback(new Error('[[error:user-banned]]')); | ||||
| 		} | ||||
|  | ||||
| 		if (parseInt(meta.config.requireEmailConfirmation, 10) === 1 && parseInt(userData['email:confirmed'], 10) !== 1) { | ||||
| 			return callback(new Error('[[error:email-not-confirmed]]')); | ||||
| 		} | ||||
|  | ||||
| 		Messaging.canMessage(socket.uid, touid, function(err, allowed) { | ||||
| 			if (err || !allowed) { | ||||
| 				return callback(err || new Error('[[error:chat-restricted]]')); | ||||
|   | ||||
| @@ -175,7 +175,7 @@ var	async = require('async'), | ||||
| 				return callback(new Error('[[error:user-banned]]')); | ||||
| 			} | ||||
|  | ||||
| 			if (userData.email && parseInt(meta.config.requireEmailConfirmation, 10) === 1 && parseInt(userData['email:confirmed'], 10) !== 1) { | ||||
| 			if (parseInt(meta.config.requireEmailConfirmation, 10) === 1 && parseInt(userData['email:confirmed'], 10) !== 1) { | ||||
| 				return callback(new Error('[[error:email-not-confirmed]]')); | ||||
| 			} | ||||
| 			var now = Date.now(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user