log reason for SM resume failure

This commit is contained in:
Daniel Gultsch 2024-02-28 12:01:18 +01:00
parent bab9553750
commit 6f8d8b9330
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
2 changed files with 17 additions and 3 deletions

View file

@ -1,13 +1,15 @@
package eu.siacs.conversations.utils; package eu.siacs.conversations.utils;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import eu.siacs.conversations.xml.Element;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import eu.siacs.conversations.xml.Element;
public class XmlHelper { public class XmlHelper {
public static String encodeEntities(String content) { public static String encodeEntities(String content) {
content = content.replace("&", "&"); content = content.replace("&", "&");
@ -28,4 +30,11 @@ public class XmlHelper {
child -> child != null ? child.getName() : null); child -> child != null ? child.getName() : null);
return Joiner.on(", ").join(features); 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

@ -1142,7 +1142,12 @@ public class XmppConnection implements Runnable {
mXmppConnectionService.updateConversationUi(); mXmppConnectionService.updateConversationUi();
} }
} else { } else {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": resumption failed"); Log.d(
Config.LOGTAG,
account.getJid().asBareJid()
+ ": resumption failed ("
+ XmlHelper.print(failed.getChildren())
+ ")");
} }
resetStreamId(); resetStreamId();
if (sendBindRequest) { if (sendBindRequest) {