diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java index b1ecda3c23f20a8ce309e8b29c64299531d9d132..ceb7ab48e82a51677488d48269b47248a67155fa 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -392,11 +392,11 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { } Iq packet = mXmppConnectionService.getIqGenerator().retrieveDeviceIds(account.getJid().asBareJid()); mXmppConnectionService.sendIqPacket(account, packet, response -> { - if (packet.getType() == Iq.Type.TIMEOUT) { + if (response.getType() == Iq.Type.TIMEOUT) { Log.d(Config.LOGTAG, getLogprefix(account) + "Timeout received while retrieving own Device Ids."); } else { //TODO consider calling registerDevices only after item-not-found to account for broken PEPs - final Element item = IqParser.getItem(packet); + final Element item = IqParser.getItem(response); final Set deviceIds = IqParser.deviceIds(item); Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": retrieved own device list: " + deviceIds); registerDevices(account.getJid().asBareJid(), deviceIds); @@ -744,7 +744,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { } final SettableFuture future = SettableFuture.create(); final Iq packet = mXmppConnectionService.getIqGenerator().retrieveVerificationForDevice(jid, address.getDeviceId()); - mXmppConnectionService.sendIqPacket(account, packet, (response) -> { + mXmppConnectionService.sendIqPacket(account, packet, response -> { Pair verification = IqParser.verification(response); if (verification != null) { try { @@ -850,7 +850,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { } } if (packet != null) { - mXmppConnectionService.sendIqPacket(account, packet, (response) -> { + mXmppConnectionService.sendIqPacket(account, packet, response -> { if (response.getType() == Iq.Type.RESULT) { fetchDeviceListStatus.put(jid, true); final Element item = IqParser.getItem(response); @@ -914,7 +914,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { final Jid jid = Jid.of(address.getName()); final boolean oneOfOurs = jid.asBareJid().equals(account.getJid().asBareJid()); final Iq bundlesPacket = mXmppConnectionService.getIqGenerator().retrieveBundlesForDevice(jid, address.getDeviceId()); - mXmppConnectionService.sendIqPacket(account, bundlesPacket, (packet) -> { + mXmppConnectionService.sendIqPacket(account, bundlesPacket, packet -> { if (packet.getType() == Iq.Type.TIMEOUT) { fetchStatusMap.put(address, FetchStatus.TIMEOUT); sessionSettableFuture.setException(new CryptoFailedException("Unable to build session. Timeout"));