From 5cadc81de4b80c087aa767e724bf13392e5c5a25 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 30 Apr 2017 16:21:13 +0200 Subject: [PATCH] support for jingle ft:5. fixes #2458 --- .../eu/siacs/conversations/generator/AbstractGenerator.java | 1 + .../eu/siacs/conversations/xmpp/jingle/JingleConnection.java | 4 +++- .../eu/siacs/conversations/xmpp/jingle/stanzas/Content.java | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java index aff2ce48..6db39cde 100644 --- a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java @@ -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", diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java index a7bb6697..44faaca8 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java @@ -302,7 +302,9 @@ public class JingleConnection implements Transferable { ServiceDiscoveryResult result = presence != null ? presence.getServiceDiscoveryResult() : null; if (result != null) { List 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; } } diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java index 49f52bf3..12ea6999 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java @@ -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; }