diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp index 4117041..5059a7c 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.cpp @@ -1,39 +1,37 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ -#pragma clang diagnostic ignored "-Wunused-private-field" - #include <Swiften/Serializer/PayloadSerializers/PubSubOptionsSerializer.h> -#include <Swiften/Serializer/XML/XMLElement.h> -#include <boost/smart_ptr/make_shared.hpp> -#include <Swiften/Serializer/PayloadSerializerCollection.h> +#include <memory> + #include <Swiften/Serializer/PayloadSerializers/FormSerializer.h> +#include <Swiften/Serializer/XML/XMLElement.h> #include <Swiften/Serializer/XML/XMLRawTextNode.h> using namespace Swift; -PubSubOptionsSerializer::PubSubOptionsSerializer(PayloadSerializerCollection* serializers) : serializers(serializers) { +PubSubOptionsSerializer::PubSubOptionsSerializer(PayloadSerializerCollection* /*serializers*/) { } PubSubOptionsSerializer::~PubSubOptionsSerializer() { } -std::string PubSubOptionsSerializer::serializePayload(boost::shared_ptr<PubSubOptions> payload) const { - if (!payload) { - return ""; - } - XMLElement element("options", "http://jabber.org/protocol/pubsub"); - element.setAttribute("node", payload->getNode()); - element.setAttribute("jid", payload->getJID()); - element.addNode(boost::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData()))); - if (payload->getSubscriptionID()) { - element.setAttribute("subid", *payload->getSubscriptionID()); - } - return element.serialize(); +std::string PubSubOptionsSerializer::serializePayload(std::shared_ptr<PubSubOptions> payload) const { + if (!payload) { + return ""; + } + XMLElement element("options", "http://jabber.org/protocol/pubsub"); + element.setAttribute("node", payload->getNode()); + element.setAttribute("jid", payload->getJID()); + element.addNode(std::make_shared<XMLRawTextNode>(FormSerializer().serialize(payload->getData()))); + if (payload->getSubscriptionID()) { + element.setAttribute("subid", *payload->getSubscriptionID()); + } + return element.serialize(); } |