diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-13 21:10:36 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-13 21:10:36 +0200 |
commit | 084ab51b1d7625cdf1cca4cc6a31715acffe5ce7 (patch) | |
tree | bd1ab4b6d48aaafd4e410b50d7f5f3d7fd8e5f14 /src/eu/siacs/conversations/xmpp/jingle/stanzas | |
parent | 7dfe4ae0823238da216088f80de40b9ff6b1446d (diff) |
transmitting files between two conversations works. no error handling and no ui on the receiving end
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/jingle/stanzas')
-rw-r--r-- | src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java b/src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java index c9015d39..79e04610 100644 --- a/src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java +++ b/src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java @@ -56,6 +56,14 @@ public class Content extends Element { } } + public String getTransportId() { + Element transport = this.findChild("transport", "urn:xmpp:jingle:transports:s5b:1"); + if (transport==null) { + return null; + } + return transport.getAttribute("sid"); + } + public String getUsedCandidate() { Element transport = this.findChild("transport", "urn:xmpp:jingle:transports:s5b:1"); if (transport==null) { @@ -68,6 +76,17 @@ public class Content extends Element { return usedCandidate.getAttribute("cid"); } } + + public void setUsedCandidate(String transportId, String cid) { + 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(); + Element usedCandidate = transport.addChild("candidate-used"); + usedCandidate.setAttribute("cid",cid); + } public void addCandidate(Element candidate) { Element transport = this.findChild("transport", "urn:xmpp:jingle:transports:s5b:1"); |