only explicitly request device list for users not in roster fixups

This commit is contained in:
Daniel Gultsch 2018-02-24 10:03:22 +01:00
parent a09d63d9a4
commit 90ace36b18
2 changed files with 12 additions and 2 deletions

View File

@ -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<Jid> 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());
}
}

View File

@ -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()) {