Pārlūkot izejas kodu

Don't show new messages indicator for CSN messages

JC Brand 6 gadi atpakaļ
vecāks
revīzija
682bace83b
2 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 2 2
      dist/converse.js
  2. 2 2
      src/converse-chatview.js

+ 2 - 2
dist/converse.js

@@ -61123,7 +61123,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
           // XXX: Is this still needed?
           // XXX: Is this still needed?
           this.el.setAttribute('id', this.model.get('box_id'));
           this.el.setAttribute('id', this.model.get('box_id'));
           this.el.innerHTML = tpl_chatbox(_.extend(this.model.toJSON(), {
           this.el.innerHTML = tpl_chatbox(_.extend(this.model.toJSON(), {
-            unread_msgs: __('You have unread messages')
+            'unread_msgs': __('You have unread messages')
           }));
           }));
           this.content = this.el.querySelector('.chat-content');
           this.content = this.el.querySelector('.chat-content');
           this.renderMessageForm();
           this.renderMessageForm();
@@ -61554,7 +61554,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
               // when the user writes a message as opposed to when a
               // when the user writes a message as opposed to when a
               // message is received.
               // message is received.
               this.model.set('scrolled', false);
               this.model.set('scrolled', false);
-            } else if (this.model.get('scrolled', true)) {
+            } else if (this.model.get('scrolled', true) && !u.isOnlyChatStateNotification(message)) {
               this.showNewMessagesIndicator();
               this.showNewMessagesIndicator();
             }
             }
           }
           }

+ 2 - 2
src/converse-chatview.js

@@ -336,7 +336,7 @@
                     this.el.setAttribute('id', this.model.get('box_id'));
                     this.el.setAttribute('id', this.model.get('box_id'));
                     this.el.innerHTML = tpl_chatbox(
                     this.el.innerHTML = tpl_chatbox(
                         _.extend(this.model.toJSON(), {
                         _.extend(this.model.toJSON(), {
-                                unread_msgs: __('You have unread messages')
+                                'unread_msgs': __('You have unread messages')
                             }
                             }
                         ));
                         ));
                     this.content = this.el.querySelector('.chat-content');
                     this.content = this.el.querySelector('.chat-content');
@@ -754,7 +754,7 @@
                             // when the user writes a message as opposed to when a
                             // when the user writes a message as opposed to when a
                             // message is received.
                             // message is received.
                             this.model.set('scrolled', false);
                             this.model.set('scrolled', false);
-                        } else if (this.model.get('scrolled', true)) {
+                        } else if (this.model.get('scrolled', true) && !u.isOnlyChatStateNotification(message)) {
                             this.showNewMessagesIndicator();
                             this.showNewMessagesIndicator();
                         }
                         }
                     }
                     }