diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp index 8c0c605..2245030 100644 --- a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -11,19 +11,19 @@ namespace Swift { SoftwareVersionSerializer::SoftwareVersionSerializer() : GenericPayloadSerializer<SoftwareVersion>() { } -std::string SoftwareVersionSerializer::serializePayload(boost::shared_ptr<SoftwareVersion> version) const { - std::string result("<query xmlns=\"jabber:iq:version\">"); - if (!version->getName().empty()) { - result += "<name>" + version->getName() + "</name>"; - } - if (!version->getVersion().empty()) { - result += "<version>" + version->getVersion() + "</version>"; - } - if (!version->getOS().empty()) { - result += "<os>" + version->getOS() + "</os>"; - } - result += "</query>"; - return result; +std::string SoftwareVersionSerializer::serializePayload(std::shared_ptr<SoftwareVersion> version) const { + std::string result("<query xmlns=\"jabber:iq:version\">"); + if (!version->getName().empty()) { + result += "<name>" + version->getName() + "</name>"; + } + if (!version->getVersion().empty()) { + result += "<version>" + version->getVersion() + "</version>"; + } + if (!version->getOS().empty()) { + result += "<os>" + version->getOS() + "</os>"; + } + result += "</query>"; + return result; } } |