hide_offline_users option

This will hide users with offline status, show_only_users still
takes precendence if enabled.
This commit is contained in:
Guillermo Bonvehí 2014-11-14 15:42:27 -03:00
parent 572b3e8d74
commit 6ab3a7cf6b

View File

@ -226,6 +226,7 @@
this.roster_groups = false; this.roster_groups = false;
this.show_controlbox_by_default = false; this.show_controlbox_by_default = false;
this.show_only_online_users = false; this.show_only_online_users = false;
this.hide_offline_users = false;
this.show_toolbar = true; this.show_toolbar = true;
this.storage = 'session'; this.storage = 'session';
this.use_otr_by_default = false; this.use_otr_by_default = false;
@ -272,6 +273,7 @@
'roster_groups', 'roster_groups',
'show_controlbox_by_default', 'show_controlbox_by_default',
'show_only_online_users', 'show_only_online_users',
'hide_offline_users',
'show_toolbar', 'show_toolbar',
'sid', 'sid',
'storage', 'storage',
@ -3247,7 +3249,12 @@
}, },
showInRoster: function () { showInRoster: function () {
return (!converse.show_only_online_users || this.get('chat_status') === 'online'); var chatStatus = this.get('chat_status');
if (converse.show_only_online_users && chatStatus !== 'online')
return false;
if (converse.hide_offline_users && chatStatus === 'offline')
return false;
return true;
} }
}); });