소스 검색

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.
JC Brand 9 년 전
부모
커밋
4d28ae3c11
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/converse-chatview.js
  2. 1 1
      src/converse-core.js

+ 1 - 1
src/converse-chatview.js

@@ -323,7 +323,7 @@
                 handleChatStateMessage: function (message) {
                     if (message.get('chat_state') === converse.COMPOSING) {
                         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) {
                         this.showStatusNotification(message.get('fullname')+' '+__('has stopped typing'));
                     } else if (_.contains([converse.INACTIVE, converse.ACTIVE], message.get('chat_state'))) {

+ 1 - 1
src/converse-core.js

@@ -162,7 +162,7 @@
 
         // Instance level constants
         this.TIMEOUTS = { // Set as module attr so that we can override in tests.
-            'PAUSED':     20000,
+            'PAUSED':     10000,
             'INACTIVE':   90000
         };