summaryrefslogtreecommitdiffstats
blob: 0ab2b872afac72906032f6c5b7cca53635a971e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * Copyright (c) 2017 Tarun Gupta
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#include <Swiften/Parser/PayloadParsers/MIXParticipantParser.h>

namespace Swift {

void MIXParticipantParser::handleTree(ParserElement::ref root) {
    for (const auto& child : root->getAllChildren()) {
        if (child->getName() == "nick" && child->getNamespace() == root->getNamespace()) {
            getPayloadInternal()->setNick(child->getText());
        }
        else if (child->getName() == "jid" && child->getNamespace() == root->getNamespace()) {
            if (boost::optional<JID> jid = JID::parse(child->getText())) {
                getPayloadInternal()->setJID(*jid);
            }
        }
    }
}

}