user.isOnline fix

wont hit db on every user socket connect or user disconnect
This commit is contained in:
barisusakli
2014-09-06 22:08:55 -04:00
parent fe58ea55d4
commit b7ee875b12
10 changed files with 90 additions and 104 deletions

View File

@@ -125,6 +125,19 @@ define('forum/chats', ['string', 'sounds'], function(S, sounds) {
$('.chats-list li[data-uid="' + withUid + '"]').removeClass('typing');
});
socket.on('event:user_status_change', function(data) {
var userEl = $('.chats-list li[data-uid="' + data.uid +'"]');
if (userEl.length) {
var statusEl = userEl.find('.status');
translator.translate('[[global:' + data.status + ']]', function(translated) {
statusEl.attr('class', 'fa fa-circle status ' + data.status)
.attr('title', translated)
.attr('data-original-title', translated);
});
}
});
};
Chats.resizeMainWindow = function() {