diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp new file mode 100644 index 0000000..71ad9a2 --- /dev/null +++ b/Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.cpp @@ -0,0 +1,23 @@ +#include "Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h" + +namespace Swift { + +SoftwareVersionSerializer::SoftwareVersionSerializer() : GenericPayloadSerializer<SoftwareVersion>() { +} + +String SoftwareVersionSerializer::serializePayload(boost::shared_ptr<SoftwareVersion> version) const { + String result("<query xmlns=\"jabber:iq:version\">"); + if (!version->getName().isEmpty()) { + result += "<name>" + version->getName() + "</name>"; + } + if (!version->getVersion().isEmpty()) { + result += "<version>" + version->getVersion() + "</version>"; + } + if (!version->getOS().isEmpty()) { + result += "<os>" + version->getOS() + "</os>"; + } + result += "</query>"; + return result; +} + +} |