From c2592d141730694e95fda76db9c52f23aa8b1882 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 5 Feb 2024 15:59:06 +0100 Subject: [PATCH] fixup: simplify loginInfo null check --- .gitignore | 1 + .../conversations/xmpp/XmppConnection.java | 34 +++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index c689a5f59..e2091fa3d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ src/quicksyPlaystore/res/values/push.xml build/ captures/ signing.properties +signing.managed.properties # Ignore Gradle GUI config gradle-app.setting diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 6d77ca800..38ad748fe 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -615,12 +615,29 @@ public class XmppConnection implements Runnable { } else if (nextTag.isStart("challenge")) { final Element challenge = tagReader.readElement(nextTag); processChallenge(challenge); + } else if (this.streamId != null + && nextTag.isStart("resumed", Namespace.STREAM_MANAGEMENT)) { + final Element resumed = tagReader.readElement(nextTag); + processResumed(resumed); + } else if (nextTag.isStart("failed", Namespace.STREAM_MANAGEMENT)) { + final Element failed = tagReader.readElement(nextTag); + processFailed(failed, true); + } else if (nextTag.isStart("iq", Namespace.JABBER_CLIENT)) { + processIq(nextTag); + } else if (!isBound) { + Log.d( + Config.LOGTAG, + account.getJid().asBareJid() + + ": server sent unexpected" + + nextTag.identifier()); + throw new StateChangingException(Account.State.INCOMPATIBLE_SERVER); + } else if (nextTag.isStart("message", Namespace.JABBER_CLIENT)) { + processMessage(nextTag); + } else if (nextTag.isStart("presence", Namespace.JABBER_CLIENT)) { + processPresence(nextTag); } else if (nextTag.isStart("enabled", Namespace.STREAM_MANAGEMENT)) { final Element enabled = tagReader.readElement(nextTag); processEnabled(enabled); - } else if (nextTag.isStart("resumed", Namespace.STREAM_MANAGEMENT)) { - final Element resumed = tagReader.readElement(nextTag); - processResumed(resumed); } else if (nextTag.isStart("r", Namespace.STREAM_MANAGEMENT)) { tagReader.readElement(nextTag); if (Config.EXTENDED_SM_LOGGING) { @@ -675,17 +692,6 @@ public class XmppConnection implements Runnable { if (acknowledgedMessages) { mXmppConnectionService.updateConversationUi(); } - } else if (nextTag.isStart("failed", Namespace.STREAM_MANAGEMENT)) { - final Element failed = tagReader.readElement(nextTag); - processFailed(failed, true); - } else if (nextTag.isStart("iq", Namespace.JABBER_CLIENT)) { - processIq(nextTag); - } else if (!isBound) { - throw new StateChangingException(Account.State.INCOMPATIBLE_SERVER); - } else if (nextTag.isStart("message", Namespace.JABBER_CLIENT)) { - processMessage(nextTag); - } else if (nextTag.isStart("presence", Namespace.JABBER_CLIENT)) { - processPresence(nextTag); } else { Log.e( Config.LOGTAG,