v1.18.x
Barış Soner Uşaklı 7 years ago
parent 7b45a6ea8b
commit 245e1a9159

@ -73,9 +73,9 @@
"nodebb-plugin-spam-be-gone": "0.5.3",
"nodebb-rewards-essentials": "0.0.11",
"nodebb-theme-lavender": "5.0.3",
"nodebb-theme-persona": "7.2.25",
"nodebb-theme-persona": "7.2.26",
"nodebb-theme-slick": "1.1.4",
"nodebb-theme-vanilla": "8.1.10",
"nodebb-theme-vanilla": "8.1.11",
"nodebb-widget-essentials": "4.0.2",
"nodemailer": "4.4.1",
"passport": "^0.4.0",

@ -17,30 +17,36 @@ app.isConnected = false;
socket = io(config.websocketAddress, ioParams);
socket.on('connect', onConnect);
if (parseInt(app.user.uid, 10) >= 0) {
addHandlers();
}
socket.on('reconnecting', onReconnecting);
function addHandlers() {
socket.on('connect', onConnect);
socket.on('disconnect', onDisconnect);
socket.on('reconnecting', onReconnecting);
socket.on('reconnect_failed', function () {
// Wait ten times the reconnection delay and then start over
setTimeout(socket.connect.bind(socket), parseInt(config.reconnectionDelay, 10) * 10);
});
socket.on('disconnect', onDisconnect);
socket.on('checkSession', function (uid) {
if (parseInt(uid, 10) !== parseInt(app.user.uid, 10)) {
app.handleInvalidSession();
}
});
socket.on('reconnect_failed', function () {
// Wait ten times the reconnection delay and then start over
setTimeout(socket.connect.bind(socket), parseInt(config.reconnectionDelay, 10) * 10);
});
socket.on('setHostname', function (hostname) {
app.upstreamHost = hostname;
});
socket.on('checkSession', function (uid) {
if (parseInt(uid, 10) !== parseInt(app.user.uid, 10)) {
app.handleInvalidSession();
}
});
socket.on('event:banned', onEventBanned);
socket.on('setHostname', function (hostname) {
app.upstreamHost = hostname;
});
socket.on('event:banned', onEventBanned);
socket.on('event:alert', app.alert);
socket.on('event:alert', app.alert);
}
function onConnect() {
app.isConnected = true;

@ -251,7 +251,7 @@ module.exports = function (middleware) {
data.templateValues.useCustomJS = parseInt(meta.config.useCustomJS, 10) === 1;
data.templateValues.customJS = data.templateValues.useCustomJS ? meta.config.customJS : '';
data.templateValues.isSpider = req.isSpider();
req.app.render('footer', data.templateValues, next);
},
], callback);

Loading…
Cancel
Save