mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	removed realtime update of anon count
This commit is contained in:
		@@ -22,12 +22,8 @@ define('forum/users', function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		handleSearch();
 | 
							handleSearch();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		socket.removeListener('user.anonDisconnect', updateAnonCount);
 | 
					 | 
				
			||||||
		socket.removeListener('user.anonConnect', updateAnonCount);
 | 
					 | 
				
			||||||
		socket.removeListener('user.isOnline', onUserIsOnline);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		socket.on('user.anonDisconnect', updateAnonCount);
 | 
							socket.removeListener('user.isOnline', onUserIsOnline);
 | 
				
			||||||
		socket.on('user.anonConnect', updateAnonCount);
 | 
					 | 
				
			||||||
		socket.on('user.isOnline', onUserIsOnline);
 | 
							socket.on('user.isOnline', onUserIsOnline);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -158,7 +154,6 @@ define('forum/users', function() {
 | 
				
			|||||||
		var section = getActiveSection();
 | 
							var section = getActiveSection();
 | 
				
			||||||
		if((section.indexOf('online') === 0 || section.indexOf('users') === 0)  && !loadingMoreUsers) {
 | 
							if((section.indexOf('online') === 0 || section.indexOf('users') === 0)  && !loadingMoreUsers) {
 | 
				
			||||||
			updateUser(data);
 | 
								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() {
 | 
						function getActiveSection() {
 | 
				
			||||||
		var url = window.location.href,
 | 
							var url = window.location.href,
 | 
				
			||||||
			parts = url.split('/');
 | 
								parts = url.split('/');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -99,7 +99,6 @@ Sockets.init = function(server) {
 | 
				
			|||||||
						});
 | 
											});
 | 
				
			||||||
					});
 | 
										});
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					socket.broadcast.emit('user.anonConnect');
 | 
					 | 
				
			||||||
					socket.emit('event:connect', {
 | 
										socket.emit('event:connect', {
 | 
				
			||||||
						status: 1,
 | 
											status: 1,
 | 
				
			||||||
						username: '[[global:guest]]',
 | 
											username: '[[global:guest]]',
 | 
				
			||||||
@@ -120,10 +119,6 @@ Sockets.init = function(server) {
 | 
				
			|||||||
				});
 | 
									});
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (!uid) {
 | 
					 | 
				
			||||||
				socket.broadcast.emit('user.anonDisconnect');
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			emitOnlineUserCount();
 | 
								emitOnlineUserCount();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			for(var roomName in io.sockets.manager.roomClients[socket.id]) {
 | 
								for(var roomName in io.sockets.manager.roomClients[socket.id]) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user