diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp index 45107d5..0b61c04 100644 --- a/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.cpp @@ -1,18 +1,21 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ +#include <Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h> + +#include <memory> + #include <boost/lexical_cast.hpp> -#include <boost/smart_ptr/make_shared.hpp> -#include <Swiften/Serializer/XML/XMLElement.h> -#include <Swiften/Serializer/XML/XMLRawTextNode.h> + #include <Swiften/Serializer/PayloadSerializerCollection.h> #include <Swiften/Serializer/PayloadSerializers/FormSerializer.h> #include <Swiften/Serializer/PayloadSerializers/ForwardedSerializer.h> -#include <Swiften/Serializer/PayloadSerializers/MAMQuerySerializer.h> #include <Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h> +#include <Swiften/Serializer/XML/XMLElement.h> +#include <Swiften/Serializer/XML/XMLRawTextNode.h> using namespace Swift; @@ -22,28 +25,28 @@ MAMQuerySerializer::MAMQuerySerializer() { MAMQuerySerializer::~MAMQuerySerializer() { } -std::string MAMQuerySerializer::serializePayload(boost::shared_ptr<MAMQuery> payload) const { - if (!payload) { - return ""; - } +std::string MAMQuerySerializer::serializePayload(std::shared_ptr<MAMQuery> payload) const { + if (!payload) { + return ""; + } - XMLElement element("query", "urn:xmpp:mam:0"); + XMLElement element("query", "urn:xmpp:mam:0"); - if (payload->getQueryID()) { - element.setAttribute("queryid", *payload->getQueryID()); - } + if (payload->getQueryID()) { + element.setAttribute("queryid", *payload->getQueryID()); + } - if (payload->getNode()) { - element.setAttribute("node", *payload->getNode()); - } + if (payload->getNode()) { + element.setAttribute("node", *payload->getNode()); + } - if (payload->getForm()) { - element.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getForm()))); - } + if (payload->getForm()) { + element.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getForm()))); + } - if (payload->getResultSet()) { - element.addNode(boost::make_shared<XMLRawTextNode>(ResultSetSerializer().serialize(payload->getResultSet()))); - } + if (payload->getResultSet()) { + element.addNode(std::make_shared<XMLRawTextNode>(ResultSetSerializer().serialize(payload->getResultSet()))); + } - return element.serialize(); + return element.serialize(); } |