From aa8e0b3c4d97cb3cf47e9214610a3dc4eda4cd6a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 2 May 2023 15:35:27 +0200 Subject: [PATCH] remember bound stream features. fixes #45 --- .../java/eu/siacs/conversations/xmpp/XmppConnection.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 010cb76c7..40828ef79 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -161,6 +161,7 @@ public class XmppConnection implements Runnable { private boolean quickStartInProgress = false; private boolean isBound = false; private Element streamFeatures; + private Element boundStreamFeatures; private String streamId = null; private int stanzasReceived = 0; private int stanzasSent = 0; @@ -776,6 +777,10 @@ public class XmppConnection implements Runnable { } final boolean processNopStreamFeatures; if (resumed != null && streamId != null) { + if (this.boundStreamFeatures != null) { + this.streamFeatures = this.boundStreamFeatures; + Log.d(Config.LOGTAG, "putting previous stream features back in place: " + XmlHelper.printElementNames(this.boundStreamFeatures)); + } processResumed(resumed); } else if (failed != null) { processFailed(failed, false); // wait for new stream features @@ -829,6 +834,7 @@ public class XmppConnection implements Runnable { // a successful resume will not send stream features if (processNopStreamFeatures) { processNopStreamFeatures(); + this.boundStreamFeatures = this.streamFeatures; } } mXmppConnectionService.databaseBackend.updateAccount(account); @@ -1388,6 +1394,7 @@ public class XmppConnection implements Runnable { throw new StateChangingException(Account.State.INCOMPATIBLE_SERVER); } } else { + Log.d( Config.LOGTAG, account.getJid().asBareJid() @@ -2422,6 +2429,7 @@ public class XmppConnection implements Runnable { private void resetStreamId() { this.streamId = null; + this.boundStreamFeatures = null; } private List> findDiscoItemsByFeature(final String feature) {