Commit f7a57f27 authored by JC Brand's avatar JC Brand

Remove `show_only_online_users` config setting.

Doesn't appear to be very useful. IIRC it was added as a workaround for
slow roster issues.
parent 053e8257
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* `_converse.api.rooms.get` * `_converse.api.rooms.get`
* `_converse.api.rooms.create` * `_converse.api.rooms.create`
- The `show_only_online_users` setting has been removed.
## 5.0.4 (2019-10-08) ## 5.0.4 (2019-10-08)
- New config option [allow_message_corrections](https://conversejs.org/docs/html/configuration.html#allow-message-corrections) - New config option [allow_message_corrections](https://conversejs.org/docs/html/configuration.html#allow-message-corrections)
which, if set to `last`, limits editing of sent messages to the last message sent. which, if set to `last`, limits editing of sent messages to the last message sent.
......
...@@ -788,7 +788,7 @@ hide_offline_users ...@@ -788,7 +788,7 @@ hide_offline_users
* Default: ``false`` * Default: ``false``
If set to ``true``, then don't show offline users. If set to ``true``, then offline users aren't shown in the roster.
hide_open_bookmarks hide_open_bookmarks
------------------- -------------------
...@@ -1491,20 +1491,6 @@ show_images_inline ...@@ -1491,20 +1491,6 @@ show_images_inline
If set to false, images won't be rendered in chats, instead only their links will be shown. If set to false, images won't be rendered in chats, instead only their links will be shown.
show_only_online_users
----------------------
* Default: ``false``
If set to ``true``, only online users will be shown in the contacts roster.
Users with any other status (e.g. away, busy etc.) will not be shown.
show_send_button
----------------
* Default: ``false``
If set to ``true``, a button will be visible which can be clicked to send a message.
singleton singleton
--------- ---------
......
...@@ -42,7 +42,6 @@ converse.plugins.add('converse-rosterview', { ...@@ -42,7 +42,6 @@ converse.plugins.add('converse-rosterview', {
'allow_contact_removal': true, 'allow_contact_removal': true,
'hide_offline_users': false, 'hide_offline_users': false,
'roster_groups': true, 'roster_groups': true,
'show_only_online_users': false,
'show_toolbar': true, 'show_toolbar': true,
'xhr_user_search_url': null, 'xhr_user_search_url': null,
}); });
...@@ -461,16 +460,17 @@ converse.plugins.add('converse-rosterview', { ...@@ -461,16 +460,17 @@ converse.plugins.add('converse-rosterview', {
return this; return this;
}, },
mayBeShown () { /**
/* Return a boolean indicating whether this contact should * Returns a boolean indicating whether this contact should
* generally be visible in the roster. * generally be visible in the roster.
*
* It doesn't check for the more specific case of whether * It doesn't check for the more specific case of whether
* the group it's in is collapsed. * the group it's in is collapsed.
* @private
* @method _converse.RosterContactView#mayBeShown
*/ */
mayBeShown () {
const chatStatus = this.model.presence.get('show'); const chatStatus = this.model.presence.get('show');
if ((_converse.show_only_online_users && chatStatus !== 'online') || if (_converse.hide_offline_users && chatStatus === 'offline') {
(_converse.hide_offline_users && chatStatus === 'offline')) {
// If pending or requesting, show // If pending or requesting, show
if ((this.model.get('ask') === 'subscribe') || if ((this.model.get('ask') === 'subscribe') ||
(this.model.get('subscription') === 'from') || (this.model.get('subscription') === 'from') ||
......
...@@ -569,11 +569,8 @@ converse.plugins.add('converse-roster', { ...@@ -569,11 +569,8 @@ converse.plugins.add('converse-roster', {
}, },
getNumOnlineContacts () { getNumOnlineContacts () {
let ignored = ['offline', 'unavailable']; const ignored = ['offline', 'unavailable'];
if (_converse.show_only_online_users) { return _.sum(this.models.filter(m => !ignored.includes(m.presence.get('show'))));
ignored = _.union(ignored, ['dnd', 'xa', 'away']);
}
return _.sum(this.models.filter((model) => !_.includes(ignored, model.presence.get('show'))));
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment