diff options
Diffstat (limited to 'Swiften/Parser/PayloadParsers')
5 files changed, 7 insertions, 87 deletions
diff --git a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp index 812e968..da2f596 100644 --- a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.cpp +++ b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.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. */ @@ -39,7 +39,6 @@ #include <Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParser.h> #include <Swiften/Parser/PayloadParsers/JingleFileTransferDescriptionParserFactory.h> #include <Swiften/Parser/PayloadParsers/JingleFileTransferHashParser.h> -#include <Swiften/Parser/PayloadParsers/JingleFileTransferReceivedParser.h> #include <Swiften/Parser/PayloadParsers/JingleIBBTransportMethodPayloadParser.h> #include <Swiften/Parser/PayloadParsers/JingleIBBTransportMethodPayloadParser.h> #include <Swiften/Parser/PayloadParsers/JingleParserFactory.h> @@ -142,7 +141,6 @@ FullPayloadParserFactoryCollection::FullPayloadParserFactoryCollection() { factories_.push_back(boost::make_shared<JingleFileTransferDescriptionParserFactory>(this)); factories_.push_back(boost::make_shared<GenericPayloadParserFactory<StreamInitiationFileInfoParser> >("file", "http://jabber.org/protocol/si/profile/file-transfer")); factories_.push_back(boost::make_shared<GenericPayloadParserFactory<JingleFileTransferFileInfoParser> >("file", "urn:xmpp:jingle:apps:file-transfer:4")); - factories_.push_back(boost::make_shared<GenericPayloadParserFactory<JingleFileTransferReceivedParser> >("received", "urn:xmpp:jingle:apps:file-transfer:3")); factories_.push_back(boost::make_shared<GenericPayloadParserFactory<JingleFileTransferHashParser> >("checksum")); factories_.push_back(boost::make_shared<GenericPayloadParserFactory<S5BProxyRequestParser> >("query", "http://jabber.org/protocol/bytestreams")); factories_.push_back(boost::make_shared<GenericPayloadParserFactory<WhiteboardParser> >("wb", "http://swift.im/whiteboard")); diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferReceivedParser.cpp b/Swiften/Parser/PayloadParsers/JingleFileTransferReceivedParser.cpp deleted file mode 100644 index ae56981..0000000 --- a/Swiften/Parser/PayloadParsers/JingleFileTransferReceivedParser.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2011 Tobias Markmann - * Licensed under the simplified BSD license. - * See Documentation/Licenses/BSD-simplified.txt for more information. - */ - -#include <Swiften/Parser/PayloadParsers/JingleFileTransferReceivedParser.h> - -#include <boost/shared_ptr.hpp> -#include <Swiften/Parser/PayloadParsers/StreamInitiationFileInfoParser.h> -#include <Swiften/Parser/PayloadParsers/StreamInitiationFileInfoParser.h> -#include <Swiften/Parser/GenericPayloadParserFactory.h> -#include <Swiften/Parser/PayloadParserFactory.h> - -namespace Swift { - -JingleFileTransferReceivedParser::JingleFileTransferReceivedParser() : level(0) { -} - -void JingleFileTransferReceivedParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { - if (level == 1 && element == "file") { - PayloadParserFactory* payloadParserFactory = new GenericPayloadParserFactory<StreamInitiationFileInfoParser>("file", "http://jabber.org/protocol/si/profile/file-transfer"); - if (payloadParserFactory) { - currentPayloadParser.reset(payloadParserFactory->createPayloadParser()); - } - } - - if (currentPayloadParser && level >= 1) { - currentPayloadParser->handleStartElement(element, ns, attributes); - } - - ++level; -} - -void JingleFileTransferReceivedParser::handleEndElement(const std::string& element, const std::string& ) { - --level; - if (element == "file") { - boost::shared_ptr<StreamInitiationFileInfo> fileInfo = boost::dynamic_pointer_cast<StreamInitiationFileInfo>(currentPayloadParser->getPayload()); - if (fileInfo) { - getPayloadInternal()->setFileInfo(*fileInfo); - } - } -} - -void JingleFileTransferReceivedParser::handleCharacterData(const std::string& ) { - -} - -} diff --git a/Swiften/Parser/PayloadParsers/JingleFileTransferReceivedParser.h b/Swiften/Parser/PayloadParsers/JingleFileTransferReceivedParser.h deleted file mode 100644 index d5333ad..0000000 --- a/Swiften/Parser/PayloadParsers/JingleFileTransferReceivedParser.h +++ /dev/null @@ -1,28 +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/Elements/JingleFileTransferReceived.h> -#include <Swiften/Parser/GenericPayloadParser.h> - -namespace Swift { - -class JingleFileTransferReceivedParser : public GenericPayloadParser<JingleFileTransferReceived> { -public: - JingleFileTransferReceivedParser(); - - virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); - virtual void handleEndElement(const std::string& element, const std::string&); - virtual void handleCharacterData(const std::string& data); - -private: - boost::shared_ptr<PayloadParser> currentPayloadParser; - int level; -}; - -} - diff --git a/Swiften/Parser/PayloadParsers/JingleParser.cpp b/Swiften/Parser/PayloadParsers/JingleParser.cpp index dd34458..7041a92 100644 --- a/Swiften/Parser/PayloadParsers/JingleParser.cpp +++ b/Swiften/Parser/PayloadParsers/JingleParser.cpp @@ -4,10 +4,15 @@ * 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/Parser/PayloadParsers/JingleParser.h> #include <Swiften/Parser/PayloadParserFactory.h> #include <Swiften/Elements/JingleContentPayload.h> -#include <Swiften/Elements/JingleFileTransferReceived.h> #include <Swiften/Elements/JingleFileTransferHash.h> #include <Swiften/Base/Log.h> @@ -60,11 +65,6 @@ namespace Swift { if (payload) { getPayloadInternal()->addContent(payload); } - - boost::shared_ptr<JingleFileTransferReceived> received = boost::dynamic_pointer_cast<JingleFileTransferReceived>(currentPayloadParser->getPayload()); - if (received) { - getPayloadInternal()->addPayload(received); - } boost::shared_ptr<JingleFileTransferHash> hash = boost::dynamic_pointer_cast<JingleFileTransferHash>(currentPayloadParser->getPayload()); if (hash) { diff --git a/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp index 9c166b2..05aaedf 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp @@ -19,7 +19,6 @@ #include <Swiften/Elements/JingleS5BTransportPayload.h> #include <Swiften/Elements/JingleFileTransferDescription.h> #include <Swiften/Elements/StreamInitiationFileInfo.h> -#include <Swiften/Elements/JingleFileTransferReceived.h> #include <Swiften/Elements/JingleFileTransferHash.h> #include <Swiften/Base/DateTime.h> #include <Swiften/StringCodecs/Base64.h> |