Browse Source

Ignore status messages when marking as unread

Danilo Bargen 7 years ago
parent
commit
3407e8c512
2 changed files with 10 additions and 0 deletions
  1. 5 0
      src/partials/messenger.ts
  2. 5 0
      src/services/webclient.ts

+ 5 - 0
src/partials/messenger.ts

@@ -735,6 +735,11 @@ class ConversationController {
      * avoid sending too many messages at once.
      */
     public msgRead(message: threema.Message): void {
+        // Ignore status messages
+        if (message.type === 'status') {
+            return;
+        }
+
         // Update lastReadMsg
         if (this.lastReadMsg === null || message.sortKey > this.lastReadMsg.sortKey) {
             this.lastReadMsg = message;

+ 5 - 0
src/services/webclient.ts

@@ -1082,6 +1082,11 @@ export class WebClientService {
     public requestRead(receiver, newestMessage: threema.Message): void {
         if (newestMessage.id === undefined) {
             // Message that hasn't been sent yet
+            this.$log.warn(this.logTag, 'Called requestRead on a message without id');
+            return;
+        }
+        if (newestMessage.type === 'status') {
+            this.$log.warn(this.logTag, 'Called requestRead on a status message');
             return;
         }