switch users from unknown->disconnected if user goes online
This commit is contained in:
parent
5c6d39952b
commit
d417347d3c
1 changed files with 6 additions and 3 deletions
|
@ -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';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue