From 39e4b26ff0cc8ff946f209ffaab71f1a1954c9cb Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 20 May 2018 12:10:07 +0200 Subject: [PATCH] prefetch omemo device lists only if muc has omemo enabled --- .../siacs/conversations/services/XmppConnectionService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 77f89f385..5e4a83778 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -2181,7 +2181,7 @@ public class XmppConnectionService extends Service { @Override public void onIqPacketReceived(Account account, IqPacket packet) { - + final boolean omemoEnabled = conversation.getNextEncryption() == Message.ENCRYPTION_AXOLOTL; Element query = packet.query("http://jabber.org/protocol/muc#admin"); if (packet.getType() == IqPacket.TYPE.RESULT && query != null) { for (Element child : query.getChildren()) { @@ -2190,7 +2190,8 @@ public class XmppConnectionService extends Service { if (!user.realJidMatchesAccount()) { boolean isNew = conversation.getMucOptions().updateUser(user); Contact contact = user.getContact(); - if (isNew + if (omemoEnabled + && isNew && user.getRealJid() != null && (contact == null || !contact.mutualPresenceSubscription()) && axolotlService.hasEmptyDeviceList(user.getRealJid())) {