get raw values for status and lastonline

v1.18.x
barisusakli 8 years ago
parent 13e624cc86
commit 9256c8332a

@ -38,7 +38,7 @@ var utils = require('../public/src/utils');
User.updateLastOnlineTime = function(uid, callback) { User.updateLastOnlineTime = function(uid, callback) {
callback = callback || function() {}; callback = callback || function() {};
User.getUserFields(uid, ['status', 'lastonline'], function(err, userData) { db.getObjectFields('user:' + uid, ['status', 'lastonline'], function(err, userData) {
var now = Date.now(); var now = Date.now();
if (err || userData.status === 'offline' || now - parseInt(userData.lastonline, 10) < 300000) { if (err || userData.status === 'offline' || now - parseInt(userData.lastonline, 10) < 300000) {
return callback(err); return callback(err);

Loading…
Cancel
Save