Browse Source

Don't send chat markers to users not subscribed to our presence

JC Brand 6 months ago
parent
commit
7e17eed322
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/headless/plugins/chat/model.js

+ 6 - 1
src/headless/plugins/chat/model.js

@@ -157,11 +157,16 @@ class ChatBox extends ModelWithMessages(ModelWithContact(ColorAwareModel(ChatBox
         if (to_bare_jid !== _converse.session.get('bare_jid')) {
             return false;
         }
+
         if (attrs.is_markable) {
-            if (this.contact && !attrs.is_archived && !attrs.is_carbon) {
+            if (this.contact &&
+                    !['none', 'to'].includes(this.contact.get('subscription')) &&
+                    !attrs.is_archived &&
+                    !attrs.is_carbon) {
                 sendMarker(attrs.from, attrs.msgid, 'received');
             }
             return false;
+
         } else if (attrs.marker_id) {
             const message = this.messages.findWhere({'msgid': attrs.marker_id});
             const field_name = `marker_${attrs.marker}`;