diff --git a/include/Swiften/Serializer/PayloadSerializers/HintPayloadSerializer.cpp b/include/Swiften/Serializer/PayloadSerializers/HintPayloadSerializer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..31b61c7a796e74b3934010eba98e458f966b560a --- /dev/null +++ b/include/Swiften/Serializer/PayloadSerializers/HintPayloadSerializer.cpp @@ -0,0 +1,34 @@ +/* + * Implements XEP-0334: Message Processing Hints + * Licensed under the Simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#include + +#include + +#include + +#include +#include +#include + +namespace Swift { + +HintPayloadSerializer::HintPayloadSerializer() : GenericPayloadSerializer() { +} + +std::string HintPayloadSerializer::serializePayload(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr hint) const { + std::string tagname = ""; + switch(hint->getType()) { + case HintPayload::NoPermanentStore: tagname = "no-permanent-store"; break; + case HintPayload::NoStore: tagname = "no-store"; break; + case HintPayload::NoCopy: tagname = "no-copy"; break; + case HintPayload::Store: tagname = "store"; break; + } + + return XMLElement(tagname, "urn:xmpp:hints").serialize(); +} + +}