ensure server triggered jingle iq-errors get routed properly
This commit is contained in:
parent
994fd9ecad
commit
32d55346cc
|
@ -710,7 +710,9 @@ public class XmppConnection implements Runnable {
|
||||||
if (Config.BACKGROUND_STANZA_LOGGING && mXmppConnectionService.checkListeners()) {
|
if (Config.BACKGROUND_STANZA_LOGGING && mXmppConnectionService.checkListeners()) {
|
||||||
Log.d(Config.LOGTAG, "[background stanza] " + element);
|
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);
|
return JinglePacket.upgrade((IqPacket) element);
|
||||||
} else {
|
} else {
|
||||||
return element;
|
return element;
|
||||||
|
|
|
@ -29,6 +29,7 @@ public class JinglePacket extends IqPacket {
|
||||||
|
|
||||||
public static JinglePacket upgrade(final IqPacket iqPacket) {
|
public static JinglePacket upgrade(final IqPacket iqPacket) {
|
||||||
Preconditions.checkArgument(iqPacket.hasChild("jingle", Namespace.JINGLE));
|
Preconditions.checkArgument(iqPacket.hasChild("jingle", Namespace.JINGLE));
|
||||||
|
Preconditions.checkArgument(iqPacket.getType() == TYPE.SET);
|
||||||
final JinglePacket jinglePacket = new JinglePacket();
|
final JinglePacket jinglePacket = new JinglePacket();
|
||||||
jinglePacket.setAttributes(iqPacket.getAttributes());
|
jinglePacket.setAttributes(iqPacket.getAttributes());
|
||||||
jinglePacket.setChildren(iqPacket.getChildren());
|
jinglePacket.setChildren(iqPacket.getChildren());
|
||||||
|
@ -70,11 +71,11 @@ public class JinglePacket extends IqPacket {
|
||||||
public ReasonWrapper getReason() {
|
public ReasonWrapper getReason() {
|
||||||
final Element reasonElement = getJingleChild("reason");
|
final Element reasonElement = getJingleChild("reason");
|
||||||
if (reasonElement == null) {
|
if (reasonElement == null) {
|
||||||
return new ReasonWrapper(Reason.UNKNOWN,null);
|
return new ReasonWrapper(Reason.UNKNOWN, null);
|
||||||
}
|
}
|
||||||
String text = null;
|
String text = null;
|
||||||
Reason reason = Reason.UNKNOWN;
|
Reason reason = Reason.UNKNOWN;
|
||||||
for(Element child : reasonElement.getChildren()) {
|
for (Element child : reasonElement.getChildren()) {
|
||||||
if ("text".equals(child.getName())) {
|
if ("text".equals(child.getName())) {
|
||||||
text = child.getContent();
|
text = child.getContent();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue