1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 06:12:05 +01:00

Merge pull request #153 from vanitasvitae/fixReason

Allow parsing of JingleReason.AlternativeSession
This commit is contained in:
Florian Schmaus 2017-07-08 08:24:17 +02:00 committed by GitHub
commit 8f808b38e1
2 changed files with 12 additions and 1 deletions

View file

@ -156,5 +156,9 @@ public class JingleReason implements NamedElement {
xml.closeElement(this);
return xml;
}
public String getAlternativeSessionId() {
return sessionId;
}
}
}

View file

@ -69,7 +69,14 @@ public class JingleProvider extends IQProvider<Jingle> {
case JingleReason.ELEMENT:
parser.next();
String reasonString = parser.getName();
Reason reason = Reason.fromString(reasonString);
JingleReason reason;
if (reasonString.equals("alternative-session")) {
parser.next();
String sid = parser.nextText();
reason = new JingleReason.AlternativeSession(sid);
} else {
reason = new JingleReason(Reason.fromString(reasonString));
}
builder.setReason(reason);
break;
default: