/* * Copyright (c) 2010 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include #include #include #include namespace Swift { void MUCUserPayloadParser::handleTree(ParserElement::ref root) { foreach (ParserElement::ref itemElement, root->getChildren("item", "http://jabber.org/protocol/muc#user")) { MUCItem item = MUCItemParser::itemFromTree(itemElement); getPayloadInternal()->addItem(item); } foreach (ParserElement::ref statusElement, root->getChildren("item", "http://jabber.org/protocol/muc#user")) { MUCUserPayload::StatusCode status; try { status.code = boost::lexical_cast(statusElement->getAttributes().getAttribute("code").c_str()); getPayloadInternal()->addStatusCode(status); } catch (boost::bad_lexical_cast&) { } } } }