diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java index 508168c837b57173161b8ced42bd8e9ccd2f2ea2..1bc5fa83659c3e02cfd3cb21e4d6239987d554cb 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -665,7 +665,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { final List jids = getCryptoTargets(conversation); for(Jid jid : jids) { if (!hasAny(jid) && (!deviceIds.containsKey(jid) || deviceIds.get(jid).isEmpty())) { - if (conversation.getAccount().getRoster().getContact(jid).trusted()) { + if (conversation.getAccount().getRoster().getContact(jid).mutualPresenceSubscription()) { return new Pair<>(AxolotlCapability.MISSING_KEYS,jid); } else { return new Pair<>(AxolotlCapability.MISSING_PRESENCE,jid); diff --git a/src/main/java/eu/siacs/conversations/entities/Contact.java b/src/main/java/eu/siacs/conversations/entities/Contact.java index e512b5861334e4bb4252a8f04bec7a69b8073400..70af45d409ba7e9593954ede01f734d69acaeb1a 100644 --- a/src/main/java/eu/siacs/conversations/entities/Contact.java +++ b/src/main/java/eu/siacs/conversations/entities/Contact.java @@ -118,7 +118,7 @@ public class Contact implements ListItem, Blockable { return this.systemName; } else if (this.serverName != null) { return this.serverName; - } else if (this.presenceName != null && trusted()) { + } else if (this.presenceName != null && mutualPresenceSubscription()) { return this.presenceName; } else if (jid.hasLocalpart()) { return jid.getLocalpart(); @@ -487,7 +487,7 @@ public class Contact implements ListItem, Blockable { } } - public boolean trusted() { + public boolean mutualPresenceSubscription() { return getOption(Options.FROM) && getOption(Options.TO); } diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 4ff082756ee4de50fccb05b4d7d6929d58e1d003..e3577b06332f2ec56f4626bea76c4db7028cea30 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -542,7 +542,7 @@ public class Message extends AbstractEntity { public boolean trusted() { Contact contact = this.getContact(); - return (status > STATUS_RECEIVED || (contact != null && contact.trusted())); + return (status > STATUS_RECEIVED || (contact != null && contact.mutualPresenceSubscription())); } public boolean fixCounterpart() { diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 86b7a7dc84827830951f4b72ba3a526c55b38b48..b455301211310f6cb6703f4fbd3f00d7fe5c1865 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -539,7 +539,11 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece mXmppConnectionService.updateConversationUi(); } - if (mXmppConnectionService.confirmMessages() && remoteMsgId != null && !isForwarded && !isTypeGroupChat) { + if (mXmppConnectionService.confirmMessages() + && message.trusted() + && remoteMsgId != null + && !isForwarded + && !isTypeGroupChat) { sendMessageReceipts(account, packet); } diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index fc51b81ca2ed34c692a3b4097a070f861b71b880..e8b13ddea000bd9d9adc7851b4b86ae1647d9637 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -3115,7 +3115,10 @@ public class XmppConnectionService extends Service { if (this.markRead(conversation)) { updateConversationUi(); } - if (confirmMessages() && markable != null && markable.getRemoteMsgId() != null) { + if (confirmMessages() + && markable != null + && markable.trusted() + && markable.getRemoteMsgId() != null) { Log.d(Config.LOGTAG, conversation.getAccount().getJid().toBareJid() + ": sending read marker to " + markable.getCounterpart().toString()); Account account = conversation.getAccount(); final Jid to = markable.getCounterpart();