Commit 053d4070 authored by JC Brand's avatar JC Brand

Fixes #1176

Add config setting `send_chat_state_notifications`
parent b039398a
......@@ -16,6 +16,7 @@
- M4A and WEBM files, when sent as XEP-0066 Out of Band Data, are now playable directly in chat
- Updated French and Spanish translations
- Two new languages supported, [Hindi](https://hosted.weblate.org/languages/hi/conversejs/) and [Romanian](https://hosted.weblate.org/languages/ro/conversejs/)
- #1176 Add config setting [send_chat_state_notifications](https://conversejs.org/docs/html/configuration.html#send-chat-state-notifications)
- #1187 UTF-8 characters have the wrong encoding when using OMEMO
- #1189 Video playback failure
- #1220 Converse not working in Edge
......
......@@ -59889,9 +59889,10 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
// configuration settings.
_converse.api.settings.update({
'filter_by_resource': false,
'auto_join_private_chats': [],
'forward_messages': false
'filter_by_resource': false,
'forward_messages': false,
'send_chat_state_notifications': true
});
_converse.api.promises.add(['chatBoxesFetched', 'chatBoxesInitialized', 'privateChatsAutoJoined']);
......@@ -60304,16 +60305,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
* as taken from the 'chat_state' attribute of the chat box.
* See XEP-0085 Chat State Notifications.
*/
_converse.connection.send($msg({
'to': this.get('jid'),
'type': 'chat'
}).c(this.get('chat_state'), {
'xmlns': Strophe.NS.CHATSTATES
}).up().c('no-store', {
'xmlns': Strophe.NS.HINTS
}).up().c('no-permanent-store', {
'xmlns': Strophe.NS.HINTS
}));
if (_converse.send_chat_state_notifications) {
_converse.connection.send($msg({
'to': this.get('jid'),
'type': 'chat'
}).c(this.get('chat_state'), {
'xmlns': Strophe.NS.CHATSTATES
}).up().c('no-store', {
'xmlns': Strophe.NS.HINTS
}).up().c('no-permanent-store', {
'xmlns': Strophe.NS.HINTS
}));
}
},
sendFiles(files) {
......@@ -1258,6 +1258,14 @@ Converse render the emojis with [Twemoji](https://twemoji.twitter.com/).
See also `emoji_image_path`_.
send_chat_state_notifications
-----------------------------
* Default: ``true``
Determines whether chat state notifications (see `XEP-0085 <https://xmpp.org/extensions/xep-0085.html>`_)
should be sent out or not.
show_only_online_users
----------------------
......@@ -1267,7 +1275,7 @@ 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``
......
......@@ -37,9 +37,10 @@
// Refer to docs/source/configuration.rst for explanations of these
// configuration settings.
_converse.api.settings.update({
'filter_by_resource': false,
'auto_join_private_chats': [],
'filter_by_resource': false,
'forward_messages': false,
'send_chat_state_notifications': true
});
_converse.api.promises.add([
'chatBoxesFetched',
......@@ -410,12 +411,14 @@
* as taken from the 'chat_state' attribute of the chat box.
* See XEP-0085 Chat State Notifications.
*/
_converse.connection.send(
$msg({'to':this.get('jid'), 'type': 'chat'})
.c(this.get('chat_state'), {'xmlns': Strophe.NS.CHATSTATES}).up()
.c('no-store', {'xmlns': Strophe.NS.HINTS}).up()
.c('no-permanent-store', {'xmlns': Strophe.NS.HINTS})
);
if (_converse.send_chat_state_notifications) {
_converse.connection.send(
$msg({'to':this.get('jid'), 'type': 'chat'})
.c(this.get('chat_state'), {'xmlns': Strophe.NS.CHATSTATES}).up()
.c('no-store', {'xmlns': Strophe.NS.HINTS}).up()
.c('no-permanent-store', {'xmlns': Strophe.NS.HINTS})
);
}
},
......
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