diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-11 21:13:09 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-11 21:13:09 +0200 |
commit | c0e0a7086902a9d5cfbe88c4aa220abdf2ee3dde (patch) | |
tree | 0dc00906f723d0e2ad2894a711992af03ea12f21 /src/eu/siacs/conversations/xmpp/jingle/stanzas | |
parent | 51100ab48b94c55f8cce981c422e50a607f261ad (diff) |
socks5 initialisation works. doesn't get activate though
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java | 13 | ||||
-rw-r--r-- | src/eu/siacs/conversations/xmpp/jingle/stanzas/JinglePacket.java | 7 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java b/src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java index 941e6559..5ea4619f 100644 --- a/src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java +++ b/src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java @@ -1,6 +1,7 @@ package eu.siacs.conversations.xmpp.jingle.stanzas; import java.io.File; +import java.util.ArrayList; import java.util.List; import eu.siacs.conversations.xml.Element; @@ -22,14 +23,24 @@ public class Content extends Element { file.addChild("name").setContent(actualFile.getName()); } - public void setCanditates(List<Element> canditates) { + public void setCandidates(String transportId, List<Element> canditates) { Element transport = this.findChild("transport", "urn:xmpp:jingle:transports:s5b:1"); if (transport==null) { transport = this.addChild("transport", "urn:xmpp:jingle:transports:s5b:1"); } + transport.setAttribute("sid", transportId); transport.clearChildren(); for(Element canditate : canditates) { transport.addChild(canditate); } } + + public List<Element> getCanditates() { + Element transport = this.findChild("transport", "urn:xmpp:jingle:transports:s5b:1"); + if (transport==null) { + return new ArrayList<Element>(); + } else { + return transport.getChildren(); + } + } } diff --git a/src/eu/siacs/conversations/xmpp/jingle/stanzas/JinglePacket.java b/src/eu/siacs/conversations/xmpp/jingle/stanzas/JinglePacket.java index bd912ea3..83f0aec6 100644 --- a/src/eu/siacs/conversations/xmpp/jingle/stanzas/JinglePacket.java +++ b/src/eu/siacs/conversations/xmpp/jingle/stanzas/JinglePacket.java @@ -33,6 +33,13 @@ public class JinglePacket extends IqPacket { return this; } + public Content getJingleContent() { + if (this.content==null) { + this.content = new Content(); + } + return this.content; + } + public JinglePacket setReason(Reason reason) { this.reason = reason; return this; |