@ -32,8 +32,10 @@ define('forum/topic/browsing', function() {
};
Browsing.onUserLeave = function(uid) {
var activeEl = $('.thread_active_users');
var user = activeEl.find('a[data-uid="' + uid + '"]');
if (app.user.uid === parseInt(uid, 10)) {
return;
}
var user = $('.thread_active_users').find('a[data-uid="' + uid + '"]');
if (user.length) {
var count = Math.max(0, parseInt(user.attr('data-count'), 10) - 1);
user.attr('data-count', count);
@ -278,9 +278,10 @@ Sockets.getUsersInRoom = function (uid, roomName, callback) {
var uids = Sockets.getUidsInRoom(roomName);
var total = uids.length;
uids = uids.slice(0, 9);
if (uid) {
if (uid && uids.indexOf(uid.toString()) === -1) {
uids = [uid].concat(uids);
if (!uids.length) {
return callback(null, {users: [], total: 0 , room: roomName});