switch users from unknown->disconnected if user goes online

This commit is contained in:
j 2016-01-09 16:35:29 +05:30
parent 5c6d39952b
commit d417347d3c

View file

@ -1,9 +1,9 @@
'use strict';
oml.ui.statusIcon = function(user, index) {
var status = getStatus(user),
that = Ox.Element({
var status = 'unknown';
status = getStatus(user);
var that = Ox.Element({
tooltip: Ox._({
connected: 'Connected',
disconnected: 'Disconnected',
@ -42,6 +42,9 @@ oml.ui.statusIcon = function(user, index) {
}
function getStatus(data) {
if (user.id != oml.user.id && data.id == oml.user.id && data.online) {
return status == 'unknown' ? 'disconnected' : status;
}
if (!oml.user.online) {
return 'unknown';
}