mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 17:35:46 +01:00
up widget essentials
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
"nodebb-theme-lavender": "3.0.9",
|
||||
"nodebb-theme-persona": "4.0.93",
|
||||
"nodebb-theme-vanilla": "5.0.54",
|
||||
"nodebb-widget-essentials": "2.0.7",
|
||||
"nodebb-widget-essentials": "2.0.8",
|
||||
"nodemailer": "2.0.0",
|
||||
"nodemailer-sendmail-transport": "1.0.0",
|
||||
"nodemailer-smtp-transport": "^2.4.1",
|
||||
|
||||
@@ -29,15 +29,16 @@ pubsub.on('sync:stats:end', function(data) {
|
||||
stats[data.id] = data.stats;
|
||||
});
|
||||
|
||||
pubsub.on('sync:stats:guests', function() {
|
||||
var io = require('../index').server;
|
||||
|
||||
var roomClients = io.sockets.adapter.rooms;
|
||||
var guestCount = roomClients.online_guests ? roomClients.online_guests.length : 0;
|
||||
pubsub.publish('sync:stats:guests:end', guestCount);
|
||||
});
|
||||
|
||||
SocketRooms.getTotalGuestCount = function(callback) {
|
||||
var count = 0;
|
||||
pubsub.once('sync:stats:guests', function() {
|
||||
var io = require('../index').server;
|
||||
|
||||
var roomClients = io.sockets.adapter.rooms;
|
||||
var guestCount = roomClients.online_guests ? roomClients.online_guests.length : 0;
|
||||
pubsub.publish('sync:stats:guests:end', guestCount);
|
||||
});
|
||||
|
||||
pubsub.on('sync:stats:guests:end', function(guestCount) {
|
||||
count += guestCount;
|
||||
|
||||
Reference in New Issue
Block a user