removed get_username_by_uid, use getUserField(uid,'username',callback) directly

v1.18.x
Baris Usakli 12 years ago
parent 49cb5fddcd
commit ccf0f6dd73

@ -326,17 +326,13 @@ var config = require('../config.js'),
RDB.get('username:' + username + ':uid', callback);
};
User.get_username_by_uid = function(uid, callback) {
User.getUserField(uid, 'username', callback);
};
User.get_usernames_by_uids = function(uids, callback) {
var usernames = [];
for(var i=0, ii=uids.length; i<ii; ++i) {
User.get_username_by_uid(uids[i], function(username){
User.getUserField(uids[i],'username', function(username){
usernames.push(username);

@ -126,12 +126,6 @@ var SocketIO = require('socket.io').listen(global.server,{log:false}),
});
socket.on('api:user.getNameByUid', function(data) {
modules.user.get_username_by_uid(data.uid, function(data){
socket.emit('api:user.getNameByUid', data);
});
});
socket.on('user.exists', function(data) {
modules.user.exists(socket, data.username);
});

Loading…
Cancel
Save