log reason for SM resume failure

(cherry picked from commit 6f8d8b9330f86392e6645eda7041cf077c4bc371)
This commit is contained in:
Daniel Gultsch 2024-02-28 12:01:18 +01:00 committed by Arne
parent 176d57423c
commit 8fca25d3a3
2 changed files with 19 additions and 4 deletions

View file

@ -1,11 +1,14 @@
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) {
@ -23,8 +26,15 @@ public class XmlHelper {
element == null
? Collections.emptyList()
: Lists.transform(
element.getChildren(),
child -> child != null ? child.getName() : null);
element.getChildren(),
child -> child != null ? child.getName() : null);
return Joiner.on(", ").join(features);
}
public static String print(final Collection<Element> children) {
if (children == null) {
return null;
}
return Joiner.on("").join(Iterables.transform(children, Element::toString));
}
}

View file

@ -1218,7 +1218,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) {