ensure server triggered jingle iq-errors get routed properly

This commit is contained in:
Daniel Gultsch 2020-07-18 16:14:05 +02:00
parent 994fd9ecad
commit 32d55346cc
2 changed files with 6 additions and 3 deletions

View File

@ -710,7 +710,9 @@ public class XmppConnection implements Runnable {
if (Config.BACKGROUND_STANZA_LOGGING && mXmppConnectionService.checkListeners()) {
Log.d(Config.LOGTAG, "[background stanza] " + element);
}
if (element instanceof IqPacket && element.hasChild("jingle", Namespace.JINGLE)) {
if (element instanceof IqPacket
&& (((IqPacket) element).getType() == IqPacket.TYPE.SET)
&& element.hasChild("jingle", Namespace.JINGLE)) {
return JinglePacket.upgrade((IqPacket) element);
} else {
return element;

View File

@ -29,6 +29,7 @@ public class JinglePacket extends IqPacket {
public static JinglePacket upgrade(final IqPacket iqPacket) {
Preconditions.checkArgument(iqPacket.hasChild("jingle", Namespace.JINGLE));
Preconditions.checkArgument(iqPacket.getType() == TYPE.SET);
final JinglePacket jinglePacket = new JinglePacket();
jinglePacket.setAttributes(iqPacket.getAttributes());
jinglePacket.setChildren(iqPacket.getChildren());