Here's a script you can use to change the status of all users:
'use strict';
var nconf = require('nconf');
var async = require('async');
nconf.file({
file: 'config.json',
});
nconf.defaults({
base_dir: __dirname,
views_dir: './build/public/templates',
});
var db = require('./src/database');
async.series([
db.init,
setUsersOnline,
], (err) => {
if (err) {
console.error(err);
process.exit(1);
}
process.exit();
});
function setUsersOnline(callback) {
var batch = require('./src/batch');
batch.processSortedSet('users:joindate', function (uids, next) {
const lastonline = Date.now();
const data = {
lastonline,
status: 'online',
};
async.parallel([
cb => async.each(uids, (uid, next) => {
db.setObject(`user:${uid}`, data, next);
}, cb),
cb => db.sortedSetAdd('users:online', uids.map(() => lastonline), uids, cb),
], next);
}, callback);
}
Create a new file called set-users-online.js
in your main nodebb directory (the one with config.js
etc), paste that script into it, and run node set-users-online
from within that directory to set all of your users to online.
However, I'm not sure why your default for status would be Invisible in the first place. As far as I can tell, it's Online by default. You mentioned it's every user, how did you confirm that?