diff --git a/CHANGES.md b/CHANGES.md index 9ca89baf9..1c9570dfd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ - File structure reordering: All plugins are now in `./plugins` folders. - New configuration setting: [show_tab_notifications](https://conversejs.org/docs/html/configuration.html#show-tab-notifications) - New configuration setting: [muc_clear_messages_on_leave](https://conversejs.org/docs/html/configuration.html#muc-clear-messages-on-leave) +- New configuration setting: [send_chat_markers](https://conversejs.org/docs/html/configuration.html#send-chat-markers) - #1823: New config options [mam_request_all_pages](https://conversejs.org/docs/html/configuration.html#mam-request-all-pages) - Use the MUC stanza id when sending XEP-0333 markers diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 899be2746..db4b5c1f1 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -1802,6 +1802,7 @@ send_chat_state_notifications ----------------------------- * Default: ``true`` +* Allowed values: ``'active', 'composing', 'gone' 'inactive', 'paused'`` Determines whether chat state notifications (see `XEP-0085 `_) should be sent out or not. @@ -1815,7 +1816,17 @@ For example: 'send_chat_state_notifications': ['composing'] }); -Valid values are ``'active', 'composing', 'gone' 'inactive', 'paused'`` + +send_chat_markers +----------------- + +* Default: ``['received', 'displayed', 'acknowledged']`` + +Determines which (if any) of the `XEP-0333 `_ chat markers will be sent out. + +It's still up to Converse to decide when to send out the relevant markers, the +purpose of this setting is merely to turn on or off the sending of the +individual markers. show_chat_state_notifications diff --git a/src/headless/plugins/chat/index.js b/src/headless/plugins/chat/index.js index 6e21def46..e74fa3109 100644 --- a/src/headless/plugins/chat/index.js +++ b/src/headless/plugins/chat/index.js @@ -58,7 +58,8 @@ converse.plugins.add('converse-chat', { 'auto_join_private_chats': [], 'clear_messages_on_reconnection': false, 'filter_by_resource': false, - 'send_chat_state_notifications': true + 'send_chat_markers': ["received", "displayed", "acknowledged"], + 'send_chat_state_notifications': true, }); _converse.Message = ModelWithContact.extend(MessageMixin); diff --git a/src/headless/plugins/chat/model.js b/src/headless/plugins/chat/model.js index 16d506c49..7f7f14ebd 100644 --- a/src/headless/plugins/chat/model.js +++ b/src/headless/plugins/chat/model.js @@ -603,7 +603,9 @@ const ChatBox = ModelWithContact.extend({ * message, even if it didn't include a `markable` element. */ sendMarkerForMessage (msg, type='displayed', force=false) { - if (!msg) return; + if (!msg || !api.settings.get('send_chat_markers').includes(type)) { + return; + } if (msg?.get('is_markable') || force) { const from_jid = Strophe.getBareJidFromJid(msg.get('from')); sendMarker(from_jid, msg.get('msgid'), type, msg.get('type'));