/* * Copyright (c) 2011 Jan Kaluza * Licensed under the Simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include #include #include #include #include namespace Swift { XHTMLIMSerializer::XHTMLIMSerializer() : GenericPayloadSerializer() { } std::string XHTMLIMSerializer::serializePayload(boost::shared_ptr payload) const { XMLElement html("html", "http://jabber.org/protocol/xhtml-im"); boost::shared_ptr body(new XMLElement("body", "http://www.w3.org/1999/xhtml")); body->addNode(boost::shared_ptr(new XMLRawTextNode(payload->getBody()))); html.addNode(body); return html.serialize(); } }