From 6f8d8b9330f86392e6645eda7041cf077c4bc371 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 28 Feb 2024 12:01:18 +0100 Subject: [PATCH] log reason for SM resume failure --- .../eu/siacs/conversations/utils/XmlHelper.java | 13 +++++++++++-- .../eu/siacs/conversations/xmpp/XmppConnection.java | 7 ++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/XmlHelper.java b/src/main/java/eu/siacs/conversations/utils/XmlHelper.java index 7287297e3..54880be8f 100644 --- a/src/main/java/eu/siacs/conversations/utils/XmlHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/XmlHelper.java @@ -1,13 +1,15 @@ package eu.siacs.conversations.utils; import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; import com.google.common.collect.Lists; +import eu.siacs.conversations.xml.Element; + +import java.util.Collection; import java.util.Collections; import java.util.List; -import eu.siacs.conversations.xml.Element; - public class XmlHelper { public static String encodeEntities(String content) { content = content.replace("&", "&"); @@ -28,4 +30,11 @@ public class XmlHelper { child -> child != null ? child.getName() : null); return Joiner.on(", ").join(features); } + + public static String print(final Collection children) { + if (children == null) { + return null; + } + return Joiner.on("").join(Iterables.transform(children, Element::toString)); + } } diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 7011c4d54..e5ddbe9de 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -1142,7 +1142,12 @@ public class XmppConnection implements Runnable { mXmppConnectionService.updateConversationUi(); } } else { - Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": resumption failed"); + Log.d( + Config.LOGTAG, + account.getJid().asBareJid() + + ": resumption failed (" + + XmlHelper.print(failed.getChildren()) + + ")"); } resetStreamId(); if (sendBindRequest) {