Commit 4d28ae3c authored by JC Brand's avatar JC Brand

Tweak timeouts regarding status notifications.

Send a <paused/> notification after 10 seconds, instead of 20.
Auto-remove a typing notification in the chat box after 20 secs instead of 10.

This is to avoid situations where the status notification gets
auto-removed while the typer keeps on typing without long enough breaks in
between for <pause/> states, thereby causing the recipient to not be aware that
they're still typing.
parent fdb04257
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
handleChatStateMessage: function (message) { handleChatStateMessage: function (message) {
if (message.get('chat_state') === converse.COMPOSING) { if (message.get('chat_state') === converse.COMPOSING) {
this.showStatusNotification(message.get('fullname')+' '+__('is typing')); this.showStatusNotification(message.get('fullname')+' '+__('is typing'));
this.clear_status_timeout = window.setTimeout(this.clearStatusNotification.bind(this), 10000); this.clear_status_timeout = window.setTimeout(this.clearStatusNotification.bind(this), 20000);
} else if (message.get('chat_state') === converse.PAUSED) { } else if (message.get('chat_state') === converse.PAUSED) {
this.showStatusNotification(message.get('fullname')+' '+__('has stopped typing')); this.showStatusNotification(message.get('fullname')+' '+__('has stopped typing'));
} else if (_.contains([converse.INACTIVE, converse.ACTIVE], message.get('chat_state'))) { } else if (_.contains([converse.INACTIVE, converse.ACTIVE], message.get('chat_state'))) {
......
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
// Instance level constants // Instance level constants
this.TIMEOUTS = { // Set as module attr so that we can override in tests. this.TIMEOUTS = { // Set as module attr so that we can override in tests.
'PAUSED': 20000, 'PAUSED': 10000,
'INACTIVE': 90000 'INACTIVE': 90000
}; };
......
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