From 98eb49904c40c54b926bf0e2712bf6cbc33fe48d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 22 Aug 2019 09:57:39 +0200 Subject: [PATCH] fixed unlikely race between enabling carbons and discovering last MAM id --- .../java/eu/siacs/conversations/xmpp/XmppConnection.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 23bb3cf6e..049a8fe68 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -1254,9 +1254,6 @@ public class XmppConnection implements Runnable { } private void enableAdvancedStreamFeatures() { - if (getFeatures().carbons() && !features.carbonsEnabled) { - sendEnableCarbons(); - } if (getFeatures().blocking() && !features.blockListRequested) { Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": Requesting block list"); this.sendIqPacket(getIqGenerator().generateGetBlockList(), mXmppConnectionService.getIqParser()); @@ -1264,6 +1261,9 @@ public class XmppConnection implements Runnable { for (final OnAdvancedStreamFeaturesLoaded listener : advancedStreamFeaturesLoadedListeners) { listener.onAdvancedStreamFeaturesAvailable(account); } + if (getFeatures().carbons() && !features.carbonsEnabled) { + sendEnableCarbons(); + } } private void sendServiceDiscoveryItems(final Jid server) {