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'; 'use strict';
oml.ui.statusIcon = function(user, index) { oml.ui.statusIcon = function(user, index) {
var status = 'unknown';
var status = getStatus(user), status = getStatus(user);
that = Ox.Element({ var that = Ox.Element({
tooltip: Ox._({ tooltip: Ox._({
connected: 'Connected', connected: 'Connected',
disconnected: 'Disconnected', disconnected: 'Disconnected',
@ -42,6 +42,9 @@ oml.ui.statusIcon = function(user, index) {
} }
function getStatus(data) { 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) { if (!oml.user.online) {
return 'unknown'; return 'unknown';
} }