diff --git a/CHANGES.md b/CHANGES.md index 58b8e8fc0..4372abc3a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,6 +24,8 @@ * `_converse.api.rooms.get` * `_converse.api.rooms.create` +- The `show_only_online_users` setting has been removed. + ## 5.0.4 (2019-10-08) - 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. diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index d28521abf..1b523f285 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -788,7 +788,7 @@ hide_offline_users * 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 ------------------- @@ -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. -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 --------- diff --git a/src/converse-rosterview.js b/src/converse-rosterview.js index 1fddc07e7..833293e0a 100644 --- a/src/converse-rosterview.js +++ b/src/converse-rosterview.js @@ -42,7 +42,6 @@ converse.plugins.add('converse-rosterview', { 'allow_contact_removal': true, 'hide_offline_users': false, 'roster_groups': true, - 'show_only_online_users': false, 'show_toolbar': true, 'xhr_user_search_url': null, }); @@ -461,16 +460,17 @@ converse.plugins.add('converse-rosterview', { return this; }, + /** + * Returns a boolean indicating whether this contact should + * generally be visible in the roster. + * It doesn't check for the more specific case of whether + * the group it's in is collapsed. + * @private + * @method _converse.RosterContactView#mayBeShown + */ mayBeShown () { - /* Return a boolean indicating whether this contact should - * generally be visible in the roster. - * - * It doesn't check for the more specific case of whether - * the group it's in is collapsed. - */ const chatStatus = this.model.presence.get('show'); - if ((_converse.show_only_online_users && chatStatus !== 'online') || - (_converse.hide_offline_users && chatStatus === 'offline')) { + if (_converse.hide_offline_users && chatStatus === 'offline') { // If pending or requesting, show if ((this.model.get('ask') === 'subscribe') || (this.model.get('subscription') === 'from') || diff --git a/src/headless/converse-roster.js b/src/headless/converse-roster.js index 67b5039a9..e45310f18 100644 --- a/src/headless/converse-roster.js +++ b/src/headless/converse-roster.js @@ -569,11 +569,8 @@ converse.plugins.add('converse-roster', { }, getNumOnlineContacts () { - let ignored = ['offline', 'unavailable']; - if (_converse.show_only_online_users) { - ignored = _.union(ignored, ['dnd', 'xa', 'away']); - } - return _.sum(this.models.filter((model) => !_.includes(ignored, model.presence.get('show')))); + const ignored = ['offline', 'unavailable']; + return _.sum(this.models.filter(m => !ignored.includes(m.presence.get('show')))); }, /**