aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java')
-rw-r--r--src/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java19
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");