Skip to content

Node.js based forum software built for the modern web

removed realtime update of anon count

barisusakli26c0b097cfaf
diff --git a/public/src/forum/users.js b/public/src/forum/users.js
index e30ab1ae33..4df2b9c5be 100644
--- a/public/src/forum/users.js
+++ b/public/src/forum/users.js
@@ -22,12 +22,8 @@ define('forum/users', function() {
handleSearch();
- socket.removeListener('user.anonDisconnect', updateAnonCount);
- socket.removeListener('user.anonConnect', updateAnonCount);
- socket.removeListener('user.isOnline', onUserIsOnline);
- socket.on('user.anonDisconnect', updateAnonCount);
- socket.on('user.anonConnect', updateAnonCount);
+ socket.removeListener('user.isOnline', onUserIsOnline);
socket.on('user.isOnline', onUserIsOnline);
@@ -158,7 +154,6 @@ define('forum/users', function() {
var section = getActiveSection();
if((section.indexOf('online') === 0 || section.indexOf('users') === 0) && !loadingMoreUsers) {
updateUser(data);
- updateAnonCount();
}
}
@@ -188,21 +183,6 @@ define('forum/users', function() {
});
}
- function updateAnonCount() {
- var section = getActiveSection();
- if((section.indexOf('online') === 0 || section.indexOf('users') === 0) && !loadingMoreUsers) {
- socket.emit('user.getOnlineAnonCount', {} , function(err, anonCount) {
-
- if(parseInt(anonCount, 10) > 0) {
- $('#users-container .anon-user').removeClass('hide');
- $('#online_anon_count').html(anonCount);
- } else {
- $('#users-container .anon-user').addClass('hide');
- }
- });
- }
- }
-
function getActiveSection() {
var url = window.location.href,
parts = url.split('/');
diff --git a/src/socket.io/index.js b/src/socket.io/index.js
index c2aa360e01..b24c1d2132 100644
--- a/src/socket.io/index.js
+++ b/src/socket.io/index.js
@@ -99,7 +99,6 @@ Sockets.init = function(server) {
});
});
} else {
- socket.broadcast.emit('user.anonConnect');
socket.emit('event:connect', {
status: 1,
username: '[[global:guest]]',
@@ -120,10 +119,6 @@ Sockets.init = function(server) {
});
}
- if (!uid) {
- socket.broadcast.emit('user.anonDisconnect');
- }
-
emitOnlineUserCount();
for(var roomName in io.sockets.manager.roomClients[socket.id]) {