diff options
Diffstat (limited to 'Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp')
-rw-r--r-- | Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp index 483654a..6bdd517 100644 --- a/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp +++ b/Swiften/Parser/PayloadParsers/IsodeIQDelegationParser.cpp @@ -24,36 +24,36 @@ IsodeIQDelegationParser::~IsodeIQDelegationParser() { } void IsodeIQDelegationParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { - - - if (level == 1) { - if (PayloadParserFactory* factory = parsers->getPayloadParserFactory(element, ns, attributes)) { - currentPayloadParser.reset(factory->createPayloadParser()); - } - } - - if (level >= 1 && currentPayloadParser) { - currentPayloadParser->handleStartElement(element, ns, attributes); - } - ++level; + + + if (level == 1) { + if (PayloadParserFactory* factory = parsers->getPayloadParserFactory(element, ns, attributes)) { + currentPayloadParser.reset(factory->createPayloadParser()); + } + } + + if (level >= 1 && currentPayloadParser) { + currentPayloadParser->handleStartElement(element, ns, attributes); + } + ++level; } void IsodeIQDelegationParser::handleEndElement(const std::string& element, const std::string& ns) { - --level; - if (currentPayloadParser) { - if (level >= 1) { - currentPayloadParser->handleEndElement(element, ns); - } - - if (level == 1) { - getPayloadInternal()->setForward(boost::dynamic_pointer_cast<Forwarded>(currentPayloadParser->getPayload())); - currentPayloadParser.reset(); - } - } + --level; + if (currentPayloadParser) { + if (level >= 1) { + currentPayloadParser->handleEndElement(element, ns); + } + + if (level == 1) { + getPayloadInternal()->setForward(boost::dynamic_pointer_cast<Forwarded>(currentPayloadParser->getPayload())); + currentPayloadParser.reset(); + } + } } void IsodeIQDelegationParser::handleCharacterData(const std::string& data) { - if (level > 1 && currentPayloadParser) { - currentPayloadParser->handleCharacterData(data); - } + if (level > 1 && currentPayloadParser) { + currentPayloadParser->handleCharacterData(data); + } } |