closes #1011, last online wont give away your invisible status

v1.18.x
Baris Soner Usakli 11 years ago
parent dcebb0cc4c
commit 475f9bea04

@ -22,6 +22,24 @@ var path = require('path'),
Api.createRoutes = function (app) {
app.namespace('/api', function () {
app.all('*', function(req, res, next) {
if(req.user) {
user.getUserField(req.user.uid, 'status', function(err, status) {
if(err) {
return next(err);
}
if(status !== 'offline') {
user.setUserField(req.user.uid, 'lastonline', Date.now());
}
});
}
next();
});
app.get('/get_templates_listing', function (req, res) {
utils.walk(path.join(__dirname, '../../', 'public/templates'), function (err, data) {
res.json(data.concat(app.get_custom_templates()).filter(function(value, index, self) {

@ -741,7 +741,7 @@ var bcrypt = require('bcryptjs'),
User.getUserField(uid, 'username', next);
}
async.map(uids, iterator, callback);
async.map(uids, getUserName, callback);
};
User.getUserSlugsByUids = function(uids, callback) {

@ -192,7 +192,6 @@ module.exports.server = server;
logger.init(app);
app.use(express.favicon(path.join(__dirname, '../', 'public', meta.config['brand:favicon'] ? meta.config['brand:favicon'] : 'favicon.ico')));
app.use(require('less-middleware')({
@ -236,13 +235,6 @@ module.exports.server = server;
// Authentication Routes
auth.initialize(app);
app.use(function(req, res, next) {
if(req.user) {
user.setUserField(req.user.uid, 'lastonline', Date.now());
}
next();
});
next();
},
function(next) {

Loading…
Cancel
Save