diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp index 38bab8c..6f40277 100644 --- a/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MAMFinSerializer.cpp @@ -1,16 +1,19 @@ /* - * 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/MAMFinSerializer.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/MAMFinSerializer.h> #include <Swiften/Serializer/PayloadSerializers/ResultSetSerializer.h> +#include <Swiften/Serializer/XML/XMLElement.h> +#include <Swiften/Serializer/XML/XMLRawTextNode.h> using namespace Swift; @@ -20,28 +23,28 @@ MAMFinSerializer::MAMFinSerializer() { MAMFinSerializer::~MAMFinSerializer() { } -std::string MAMFinSerializer::serializePayload(boost::shared_ptr<MAMFin> payload) const { - if (!payload) { - return ""; - } +std::string MAMFinSerializer::serializePayload(std::shared_ptr<MAMFin> payload) const { + if (!payload) { + return ""; + } - XMLElement element("fin", "urn:xmpp:mam:0"); + XMLElement element("fin", "urn:xmpp:mam:0"); - if (payload->isComplete()) { - element.setAttribute("complete", "true"); - } + if (payload->isComplete()) { + element.setAttribute("complete", "true"); + } - if (!payload->isStable()) { - element.setAttribute("stable", "false"); - } + if (!payload->isStable()) { + element.setAttribute("stable", "false"); + } - if (payload->getQueryID()) { - element.setAttribute("queryid", *payload->getQueryID()); - } + if (payload->getQueryID()) { + element.setAttribute("queryid", *payload->getQueryID()); + } - 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(); } |