diff options
Diffstat (limited to 'Swiften/Serializer')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp | 2 | ||||
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h | 21 |
2 files changed, 23 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp index 93fd70f..b4822cd 100644 --- a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp +++ b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp @@ -50,6 +50,7 @@ #include <Swiften/Serializer/PayloadSerializers/SearchPayloadSerializer.h> #include <Swiften/Serializer/PayloadSerializers/ReplaceSerializer.h> #include <Swiften/Serializer/PayloadSerializers/LastSerializer.h> +#include <Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h> #include <Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.h> #include <Swiften/Serializer/PayloadSerializers/JingleContentPayloadSerializer.h> @@ -108,6 +109,7 @@ FullPayloadSerializerCollection::FullPayloadSerializerCollection() { serializers_.push_back(new SearchPayloadSerializer()); serializers_.push_back(new ReplaceSerializer()); serializers_.push_back(new LastSerializer()); + serializers_.push_back(new WhiteboardSerializer()); serializers_.push_back(new StreamInitiationFileInfoSerializer()); serializers_.push_back(new JingleContentPayloadSerializer()); diff --git a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h new file mode 100644 index 0000000..a7d04f1 --- /dev/null +++ b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2012 Mateusz Piękos + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include <Swiften/Elements/WhiteboardPayload.h> +#include <Swiften/Serializer/GenericPayloadSerializer.h> + +namespace Swift { + class WhiteboardSerializer : public GenericPayloadSerializer<WhiteboardPayload> { + public: + std::string serializePayload(boost::shared_ptr<WhiteboardPayload> payload) const { + XMLElement element("wb"); + element.addNode(XMLTextNode::ref(new XMLTextNode(payload->getData()))); + return element.serialize(); + } + }; +} |