remove unnecessary resume call

Daniel Gultsch created

Change summary

src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 7 +++-
1 file changed, 5 insertions(+), 2 deletions(-)

Detailed changes

src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java 🔗

@@ -1453,6 +1453,8 @@ public class XmppConnection implements Runnable {
                 && isSecure) {
             authenticate(SaslMechanism.Version.SASL);
         } else if (this.streamFeatures.hasChild("sm", Namespace.STREAM_MANAGEMENT)
+                && isSecure
+                && loginInfo != null
                 && streamId != null
                 && !inSmacksSession) {
             if (Config.EXTENDED_SM_LOGGING) {
@@ -1467,7 +1469,9 @@ public class XmppConnection implements Runnable {
             this.mWaitingForSmCatchup.set(true);
             this.tagWriter.writeStanzaAsync(resume);
         } else if (needsBinding) {
-            if (this.streamFeatures.hasChild("bind", Namespace.BIND) && isSecure) {
+            if (this.streamFeatures.hasChild("bind", Namespace.BIND)
+                    && isSecure
+                    && loginInfo != null) {
                 sendBindRequest();
             } else {
                 Log.d(
@@ -1478,7 +1482,6 @@ public class XmppConnection implements Runnable {
                 throw new StateChangingException(Account.State.INCOMPATIBLE_SERVER);
             }
         } else {
-
             Log.d(
                     Config.LOGTAG,
                     account.getJid().asBareJid()