From 26c0b097cfafc6e1f5c42940ae8808ba6d64bfcc Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 2 Sep 2014 13:49:48 -0400 Subject: [PATCH] removed realtime update of anon count --- public/src/forum/users.js | 22 +--------------------- src/socket.io/index.js | 5 ----- 2 files changed, 1 insertion(+), 26 deletions(-) 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]) {