exists function fix

v1.18.x
Baris Usakli 12 years ago
parent 283dbc477b
commit 8fe4905b68

@ -299,14 +299,12 @@ var config = require('../config.js'),
}
User.exists = function(socket, username, callback) {
User.exists = function(username, callback) {
User.get_uid_by_username(username, function(exists) {
exists = !!exists;
if (callback)
callback(exists);
else
socket.emit('user.exists', {exists: exists});
});
};

@ -124,7 +124,9 @@ var SocketIO = require('socket.io').listen(global.server,{log:false}),
});
socket.on('user.exists', function(data) {
modules.user.exists(socket, data.username);
modules.user.exists(data.username, function(exists){
socket.emit('user.exists', {exists: exists});
});
});
socket.on('user.count', function(data) {

Loading…
Cancel
Save