This commit is contained in:
barisusakli
2014-11-13 15:47:25 -05:00
parent 962d14746e
commit e6973b55d4
4 changed files with 28 additions and 15 deletions

View File

@@ -117,10 +117,14 @@ SocketModules.chats.get = function(socket, data, callback) {
};
SocketModules.chats.send = function(socket, data, callback) {
if(!data) {
if (!data) {
return callback(new Error('[[error:invalid-data]]'));
}
if (parseInt(meta.config.disableChat) === 1) {
return callback(new Error('[[error:chat-disabled]]'));
}
var touid = parseInt(data.touid, 10);
if (touid === socket.uid || socket.uid === 0) {
return;