aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/parser
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-02-24 15:57:53 +0100
committerChristian Schneppe <christian@pix-art.de>2018-02-24 15:57:53 +0100
commit8f11febe84f4d9ed3ee55dcea7ea4224ac741ef2 (patch)
treeffd3f94be6fa81e6ce164c37f6a5c748cf1194a4 /src/main/java/de/pixart/messenger/parser
parent34718bcbbc2f0406607766e088d89ae2445999e5 (diff)
only explicitly request device list for users not in roster
Diffstat (limited to 'src/main/java/de/pixart/messenger/parser')
-rw-r--r--src/main/java/de/pixart/messenger/parser/MessageParser.java7
-rw-r--r--src/main/java/de/pixart/messenger/parser/PresenceParser.java7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java
index 5a95c89bd..4591ca138 100644
--- a/src/main/java/de/pixart/messenger/parser/MessageParser.java
+++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java
@@ -749,6 +749,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
mXmppConnectionService.getAvatarService().clear(conversation);
mXmppConnectionService.updateMucRosterUi();
mXmppConnectionService.updateConversationUi();
+ Contact contact = user.getContact();
if (!user.getAffiliation().ranks(MucOptions.Affiliation.MEMBER)) {
Jid jid = user.getRealJid();
List<Jid> cryptoTargets = conversation.getAcceptedCryptoTargets();
@@ -757,7 +758,11 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
conversation.setAcceptedCryptoTargets(cryptoTargets);
mXmppConnectionService.updateConversation(conversation);
}
- } else if (isNew && user.getRealJid() != null && account.getAxolotlService().hasEmptyDeviceList(user.getRealJid())) {
+ } else if (isNew
+ && user.getRealJid() != null
+ && conversation.getMucOptions().isPrivateAndNonAnonymous()
+ && (contact == null || !contact.mutualPresenceSubscription())
+ && account.getAxolotlService().hasEmptyDeviceList(user.getRealJid())) {
account.getAxolotlService().fetchDeviceIds(user.getRealJid());
}
}
diff --git a/src/main/java/de/pixart/messenger/parser/PresenceParser.java b/src/main/java/de/pixart/messenger/parser/PresenceParser.java
index a58b3d016..abe5a2271 100644
--- a/src/main/java/de/pixart/messenger/parser/PresenceParser.java
+++ b/src/main/java/de/pixart/messenger/parser/PresenceParser.java
@@ -76,7 +76,12 @@ public class PresenceParser extends AbstractParser implements
}
boolean isNew = mucOptions.updateUser(user);
final AxolotlService axolotlService = conversation.getAccount().getAxolotlService();
- if (isNew && user.getRealJid() != null && mucOptions.isPrivateAndNonAnonymous() && axolotlService.hasEmptyDeviceList(user.getRealJid())) {
+ Contact contact = user.getContact();
+ if (isNew
+ && user.getRealJid() != null
+ && mucOptions.isPrivateAndNonAnonymous()
+ && (contact == null || !contact.mutualPresenceSubscription())
+ && axolotlService.hasEmptyDeviceList(user.getRealJid())) {
axolotlService.fetchDeviceIds(user.getRealJid());
}
if (codes.contains(MucOptions.STATUS_CODE_ROOM_CREATED) && mucOptions.autoPushConfiguration()) {