summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-02-04 13:56:42 (GMT)
committerSwift Review <review@swift.im>2015-02-09 14:09:18 (GMT)
commitef319397be8439482fdf95f46a29643d15980b37 (patch)
tree01b1b70cedccbbc7f5dde7d72939c3cfeeee1784 /Swiften/Serializer
parent7d3df55bf5fd93b3eaca36cc43cb22ea7879bf7e (diff)
downloadswift-ef319397be8439482fdf95f46a29643d15980b37.zip
swift-ef319397be8439482fdf95f46a29643d15980b37.tar.bz2
Update DiscoInfo string for Jingle file-transfer to :4 and remove obsolete files
Test-Information: Unit tests run successful on OS X 10.9.5 Change-Id: I9df0c798723f79df85cfc7301aed0a7ad6309904
Diffstat (limited to 'Swiften/Serializer')
-rw-r--r--Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp4
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.cpp35
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.h23
-rw-r--r--Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp8
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp33
5 files changed, 7 insertions, 96 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp
index a9a1ae3..5da0829 100644
--- a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp
+++ b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -31,7 +31,6 @@
#include <Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h>
#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferDescriptionSerializer.h>
#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h>
-#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.h>
#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.h>
#include <Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.h>
#include <Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.h>
@@ -132,7 +131,6 @@ FullPayloadSerializerCollection::FullPayloadSerializerCollection() {
serializers_.push_back(new JingleContentPayloadSerializer());
serializers_.push_back(new JingleFileTransferDescriptionSerializer());
serializers_.push_back(new JingleFileTransferHashSerializer());
- serializers_.push_back(new JingleFileTransferReceivedSerializer());
serializers_.push_back(new JingleIBBTransportPayloadSerializer());
serializers_.push_back(new JingleS5BTransportPayloadSerializer());
serializers_.push_back(new JinglePayloadSerializer(this));
diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.cpp
deleted file mode 100644
index 40be70e..0000000
--- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2011 Tobias Markmann
- * Licensed under the simplified BSD license.
- * See Documentation/Licenses/BSD-simplified.txt for more information.
- */
-
-#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.h>
-
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
-
-#include <Swiften/Base/foreach.h>
-#include <Swiften/Serializer/XML/XMLNode.h>
-#include <Swiften/Serializer/XML/XMLElement.h>
-#include <Swiften/Serializer/XML/XMLRawTextNode.h>
-
-#include <Swiften/Serializer/XML/XMLRawTextNode.h>
-
-namespace Swift {
-
-JingleFileTransferReceivedSerializer::JingleFileTransferReceivedSerializer() {
-}
-
-std::string JingleFileTransferReceivedSerializer::serializePayload(boost::shared_ptr<JingleFileTransferReceived> payload) const {
- XMLElement receivedElement("received", "urn:xmpp:jingle:apps:file-transfer:3");
- XMLElement::ref fileElement = boost::make_shared<XMLElement>("file", "http://jabber.org/protocol/si/profile/file-transfer");
- fileElement->setAttribute("hash", payload->getFileInfo().getHash());
- if (payload->getFileInfo().getAlgo() != "md5") {
- fileElement->setAttribute("algo", payload->getFileInfo().getAlgo());
- }
- receivedElement.addNode(fileElement);
- return receivedElement.serialize();
-}
-
-}
diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.h b/Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.h
deleted file mode 100644
index 4151dd0..0000000
--- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2011 Tobias Markmann
- * Licensed under the simplified BSD license.
- * See Documentation/Licenses/BSD-simplified.txt for more information.
- */
-
-
-#pragma once
-
-#include <Swiften/Serializer/GenericPayloadSerializer.h>
-#include <Swiften/Elements/JingleFileTransferReceived.h>
-
-namespace Swift {
- class PayloadSerializerCollection;
- class XMLElement;
-
- class JingleFileTransferReceivedSerializer : public GenericPayloadSerializer<JingleFileTransferReceived> {
- public:
- JingleFileTransferReceivedSerializer();
-
- virtual std::string serializePayload(boost::shared_ptr<JingleFileTransferReceived>) const;
- };
-}
diff --git a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
index 2e8ae4a..c6d6c12 100644
--- a/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JinglePayloadSerializer.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/JinglePayloadSerializer.h>
#include <boost/shared_ptr.hpp>
@@ -17,7 +23,6 @@
#include <Swiften/Serializer/XML/XMLRawTextNode.h>
#include <Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h>
#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferHashSerializer.h>
-#include <Swiften/Serializer/PayloadSerializers/JingleFileTransferReceivedSerializer.h>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
@@ -26,7 +31,6 @@
#include <Swiften/Elements/JingleIBBTransportPayload.h>
#include <Swiften/Elements/JingleFileTransferDescription.h>
#include <Swiften/Elements/JingleFileTransferHash.h>
-#include <Swiften/Elements/JingleFileTransferReceived.h>
namespace Swift {
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
index 8d5bcb7..9d9996d 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
@@ -26,7 +26,6 @@
#include <Swiften/Elements/JingleS5BTransportPayload.h>
#include <Swiften/Elements/JingleFileTransferHash.h>
#include <Swiften/Elements/JinglePayload.h>
-#include <Swiften/Elements/JingleFileTransferReceived.h>
#include <Swiften/Base/DateTime.h>
#include <Swiften/StringCodecs/Base64.h>
@@ -45,7 +44,6 @@ class JingleSerializersTest : public CppUnit::TestFixture {
CPPUNIT_TEST(testSerialize_Xep0234_Example3);
CPPUNIT_TEST(testSerialize_Xep0234_Example5);
CPPUNIT_TEST(testSerialize_Xep0234_Example8);
- CPPUNIT_TEST(testSerialize_Xep0234_Example13);
CPPUNIT_TEST(testSerialize_Xep0260_Example1);
@@ -336,37 +334,6 @@ class JingleSerializersTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(expected, createTestling()->serialize(payload));
}
- // http://xmpp.org/extensions/xep-0234.html#example-10
- void testSerialize_Xep0234_Example13() {
- std::string expected =
- "<jingle"
- " action=\"session-info\""
- " initiator=\"romeo@montague.lit/orchard\""
- " sid=\"a73sjjvkla37jfea\""
- " xmlns=\"urn:xmpp:jingle:1\">"
- "<received xmlns=\"urn:xmpp:jingle:apps:file-transfer:3\">"
- "<file"
- " hash=\"a749930852c69ae5d2141d3766b1552d\""
- " xmlns=\"http://jabber.org/protocol/si/profile/file-transfer\"/>"
- "</received>"
- "</jingle>";
-
- JinglePayload::ref payload = boost::make_shared<JinglePayload>();
- payload->setAction(JinglePayload::SessionInfo);
- payload->setInitiator(JID("romeo@montague.lit/orchard"));
- payload->setSessionID("a73sjjvkla37jfea");
-
- JingleFileTransferReceived::ref received = boost::make_shared<JingleFileTransferReceived>();
-
- StreamInitiationFileInfo fileInfo;
- fileInfo.setHash("a749930852c69ae5d2141d3766b1552d");
-
- received->setFileInfo(fileInfo);
- payload->addPayload(received);
-
- CPPUNIT_ASSERT_EQUAL(expected, createTestling()->serialize(payload));
- }
-
// http://xmpp.org/extensions/xep-0260.html#example-1
void testSerialize_Xep0260_Example1() {
std::string expected =