diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp index 8d506f8..b168fdc 100644 --- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp @@ -1,30 +1,31 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swiften/Serializer/PayloadSerializers/DelaySerializer.h> -#include <boost/shared_ptr.hpp> +#include <memory> + #include <boost/date_time/posix_time/posix_time.hpp> +#include <Swiften/Base/DateTime.h> #include <Swiften/Base/String.h> #include <Swiften/Serializer/XML/XMLElement.h> -#include <Swiften/Base/DateTime.h> namespace Swift { DelaySerializer::DelaySerializer() : GenericPayloadSerializer<Delay>() { } -std::string DelaySerializer::serializePayload(boost::shared_ptr<Delay> delay) const { - XMLElement delayElement("delay", "urn:xmpp:delay"); - if (delay->getFrom() && delay->getFrom()->isValid()) { - delayElement.setAttribute("from", delay->getFrom()->toString()); - } - delayElement.setAttribute("stamp", dateTimeToString(delay->getStamp())); - return delayElement.serialize(); +std::string DelaySerializer::serializePayload(std::shared_ptr<Delay> delay) const { + XMLElement delayElement("delay", "urn:xmpp:delay"); + if (delay->getFrom() && delay->getFrom()->isValid()) { + delayElement.setAttribute("from", delay->getFrom()->toString()); + } + delayElement.setAttribute("stamp", dateTimeToString(delay->getStamp())); + return delayElement.serialize(); } } |