|
|
@ -227,6 +227,7 @@ SocketUser.getOnlineUsers = function(socket, uids, callback) {
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
return callback(err);
|
|
|
|
return callback(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
userData.forEach(function(user) {
|
|
|
|
userData.forEach(function(user) {
|
|
|
|
if (user) {
|
|
|
|
if (user) {
|
|
|
|
returnData[user.uid] = user;
|
|
|
|
returnData[user.uid] = user;
|
|
|
@ -291,9 +292,9 @@ SocketUser.loadMore = function(socket, data, callback) {
|
|
|
|
SocketUser.setStatus = function(socket, status, callback) {
|
|
|
|
SocketUser.setStatus = function(socket, status, callback) {
|
|
|
|
var server = require('./index');
|
|
|
|
var server = require('./index');
|
|
|
|
user.setUserField(socket.uid, 'status', status, function(err) {
|
|
|
|
user.setUserField(socket.uid, 'status', status, function(err) {
|
|
|
|
SocketUser.isOnline(socket, socket.uid, function(err, data) {
|
|
|
|
SocketUser.isOnline(socket, [socket.uid], function(err, data) {
|
|
|
|
server.server.sockets.emit('user.isOnline', err, data);
|
|
|
|
server.server.sockets.emit('user.isOnline', err, data[0]);
|
|
|
|
callback(err, data);
|
|
|
|
callback(err, data[0]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|