aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-10-08 10:45:40 +0200
committerChristian Schneppe <christian@pix-art.de>2016-10-08 10:45:40 +0200
commitfd8f219e507c79c7c8623d34b8b878733b3864dc (patch)
treeb9d3fd3bd8a18ed6c0b84d7081b24319c3a9b094 /src/main/java
parente78a2ae3fe72c28eee9809f5846c0008cb944f39 (diff)
respond to chat marker request only when mutual presence subscription exists
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java2
-rw-r--r--src/main/java/de/pixart/messenger/entities/Contact.java4
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java2
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java2
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java2
5 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
index e3ea8955a..5aec10f7e 100644
--- a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
@@ -664,7 +664,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
final List<Jid> 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/de/pixart/messenger/entities/Contact.java b/src/main/java/de/pixart/messenger/entities/Contact.java
index 090486243..870b2c76c 100644
--- a/src/main/java/de/pixart/messenger/entities/Contact.java
+++ b/src/main/java/de/pixart/messenger/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) {
+ } 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/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index c518c812b..ed97b9166 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/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/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index bf99e5d75..f91fcf977 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -539,7 +539,7 @@ 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/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 342bf1638..9e4f55c29 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -3242,7 +3242,7 @@ 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();