summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers')
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp9
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp2
2 files changed, 11 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp
index c753839..220d8dd 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h>
#include <boost/shared_ptr.hpp>
@@ -25,6 +31,9 @@ std::string JingleS5BTransportPayloadSerializer::serializePayload(boost::shared_
XMLElement payloadXML("transport", "urn:xmpp:jingle:transports:s5b:1");
payloadXML.setAttribute("sid", payload->getSessionID());
payloadXML.setAttribute("mode", modeToString(payload->getMode()));
+ if (!payload->getDstAddr().empty()) {
+ payloadXML.setAttribute("dstaddr", payload->getDstAddr());
+ }
foreach(JingleS5BTransportPayload::Candidate candidate, payload->getCandidates()) {
boost::shared_ptr<XMLElement> candidateXML = boost::make_shared<XMLElement>("candidate");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
index 722c039..8d5bcb7 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
@@ -377,6 +377,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
" xmlns=\"urn:xmpp:jingle:1\">"
"<content creator=\"initiator\" name=\"ex\">"
"<transport"
+ " dstaddr=\"1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba\""
" mode=\"tcp\""
" sid=\"vj3hs98y\""
" xmlns=\"urn:xmpp:jingle:transports:s5b:1\">"
@@ -407,6 +408,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
JingleS5BTransportPayload::ref transport = boost::make_shared<JingleS5BTransportPayload>();
transport->setMode(JingleS5BTransportPayload::TCPMode);
+ transport->setDstAddr("1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba");
transport->setSessionID("vj3hs98y");
JingleS5BTransportPayload::Candidate candidate1;