support for jingle ft:5. fixes #2458

This commit is contained in:
Daniel Gultsch 2017-04-30 16:21:13 +02:00
parent 84baa3ae68
commit 5cadc81de4
3 changed files with 8 additions and 2 deletions

View File

@ -25,6 +25,7 @@ public abstract class AbstractGenerator {
"urn:xmpp:jingle:1",
Content.Version.FT_3.getNamespace(),
Content.Version.FT_4.getNamespace(),
Content.Version.FT_5.getNamespace(),
"urn:xmpp:jingle:transports:s5b:1",
"urn:xmpp:jingle:transports:ibb:1",
"http://jabber.org/protocol/muc",

View File

@ -302,7 +302,9 @@ public class JingleConnection implements Transferable {
ServiceDiscoveryResult result = presence != null ? presence.getServiceDiscoveryResult() : null;
if (result != null) {
List<String> features = result.getFeatures();
if (features.contains(Content.Version.FT_4.getNamespace())) {
if (features.contains(Content.Version.FT_5.getNamespace())) {
this.ftVersion = Content.Version.FT_5;
} else if (features.contains(Content.Version.FT_4.getNamespace())) {
this.ftVersion = Content.Version.FT_4;
}
}

View File

@ -7,7 +7,8 @@ public class Content extends Element {
public enum Version {
FT_3("urn:xmpp:jingle:apps:file-transfer:3"),
FT_4("urn:xmpp:jingle:apps:file-transfer:4");
FT_4("urn:xmpp:jingle:apps:file-transfer:4"),
FT_5("urn:xmpp:jingle:apps:file-transfer:5");
private final String namespace;
@ -37,6 +38,8 @@ public class Content extends Element {
return Version.FT_3;
} else if (hasChild("description" , Version.FT_4.namespace)) {
return Version.FT_4;
} else if (hasChild("description" , Version.FT_5.namespace)) {
return Version.FT_5;
}
return null;
}