|
|
|
@ -192,6 +192,15 @@ SocketModules.chats.send = function(socket, data, callback) {
|
|
|
|
|
|
|
|
|
|
var msg = S(data.message).stripTags().s;
|
|
|
|
|
|
|
|
|
|
user.getUserField(socket.uid, 'banned', function(err, banned) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return callback(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (parseInt(banned, 10) === 1) {
|
|
|
|
|
return callback(new Error('[[error:user-banned]]'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Messaging.addMessage(socket.uid, touid, msg, function(err, message) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return callback(err);
|
|
|
|
@ -215,6 +224,7 @@ SocketModules.chats.send = function(socket, data, callback) {
|
|
|
|
|
self: 1
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SocketModules.chats.pushUnreadCount = function(uid) {
|
|
|
|
|