diff --git a/include/Swiften/Parser/PayloadParsers/PubSubItemParser.cpp b/include/Swiften/Parser/PayloadParsers/PubSubItemParser.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f23c41a92c8dfab6899b2682e64a397202f2e57 --- /dev/null +++ b/include/Swiften/Parser/PayloadParsers/PubSubItemParser.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2012 Jan Kaluza + * Licensed under the Simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#include + +#include + +#include +#include +#include +#include +#include + +namespace Swift { + +void PubSubItemParser::handleTree(ParserElement::ref root) { + std::string id = root->getAttributes().getAttribute("id"); + if (!id.empty()) { + getPayloadInternal()->setId(id); + } + + foreach (ParserElement::ref child, root->getAllChildren()) { + getPayloadInternal()->addPayload(TreeReparser::parseTree(child, factories)); + } +} + +}