diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp new file mode 100644 index 0000000..fbb72af --- /dev/null +++ b/Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp @@ -0,0 +1,20 @@ +#include "Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.h" + +#include <boost/shared_ptr.hpp> + +#include "Swiften/Serializer/XML/XMLElement.h" + +namespace Swift { + +CapsInfoSerializer::CapsInfoSerializer() : GenericPayloadSerializer<CapsInfo>() { +} + +String CapsInfoSerializer::serializePayload(boost::shared_ptr<CapsInfo> capsInfo) const { + XMLElement capsElement("c", "http://jabber.org/protocol/caps"); + capsElement.setAttribute("node", capsInfo->getNode()); + capsElement.setAttribute("hash", capsInfo->getHash()); + capsElement.setAttribute("ver", capsInfo->getVersion()); + return capsElement.serialize(); +} + +} |