From dd7433bab6b5ccb717e79568862bcfba47847fe6 Mon Sep 17 00:00:00 2001
From: psychobunny <psycho.bunny@hotmail.com>
Date: Wed, 12 Mar 2014 18:30:06 -0400
Subject: [PATCH] fixed active users icon in thread

---
 public/src/forum/topic.js | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index b3e596448e..37ffb45a4f 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -632,23 +632,22 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
 			'event:topic.replyStart', 'event:topic.replyStop'
 		]);
 
-		socket.on('get_users_in_room', function(data) {
+		function createUserIcon(uid, picture, userslug, username) {
+			if(!$('.thread_active_users').find('[data-uid="' + uid + '"]').length) {
+				var div = $('<div class="inline-block"><a data-uid="' + uid + '" href="' + RELATIVE_PATH + '/user/' + userslug + '"><img src="'+ picture +'"/></a></div>');
+				div.find('a').tooltip({
+					placement: 'top',
+					title: username
+				});
 
+				return div;
+			}
+		}
+		
+		socket.on('get_users_in_room', function(data) {
 			if(data && data.room.indexOf('topic') !== -1) {
 				var activeEl = $('.thread_active_users');
 
-				function createUserIcon(uid, picture, userslug, username) {
-					if(!activeEl.find('[data-uid="' + uid + '"]').length) {
-						var div = $('<div class="inline-block"><a data-uid="' + uid + '" href="' + RELATIVE_PATH + '/user/' + userslug + '"><img src="'+ picture +'"/></a></div>');
-						div.find('a').tooltip({
-							placement: 'top',
-							title: username
-						});
-
-						return div;
-					}
-				}
-
 				// remove users that are no longer here
 				activeEl.find('a').each(function(index, element) {
 					if(element) {