From 90ace36b1890fc6bda21b4714891836e957e8997 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 24 Feb 2018 10:03:22 +0100 Subject: [PATCH] only explicitly request device list for users not in roster fixups --- .../java/eu/siacs/conversations/parser/MessageParser.java | 7 ++++++- .../java/eu/siacs/conversations/parser/PresenceParser.java | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 7036c9f58..3654c98e9 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -759,6 +759,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 cryptoTargets = conversation.getAcceptedCryptoTargets(); @@ -767,7 +768,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/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java index a05b1aac2..4657dbe02 100644 --- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java @@ -80,7 +80,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()) {