diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-02-06 12:12:00 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-02-06 13:39:43 (GMT) |
commit | f3d68b13e120f471326449f68aa4140587d444fc (patch) | |
tree | a13586525ee07d8aff8ec9ec459caf37fd5a941c /Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp | |
parent | 42a1bbc568aab7e5b29c7fe16c13659291d01cae (diff) | |
download | swift-contrib-f3d68b13e120f471326449f68aa4140587d444fc.zip swift-contrib-f3d68b13e120f471326449f68aa4140587d444fc.tar.bz2 |
Parse mediated invite stuff
Diffstat (limited to 'Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp')
-rw-r--r-- | Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp index 2da8b35..d206010 100644 --- a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp +++ b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp @@ -22,6 +22,25 @@ void MUCUserPayloadParser::handleTree(ParserElement::ref root) { MUCItem item = MUCItemParser::itemFromTree(child); getPayloadInternal()->addItem(item); } + else if (child->getName() == "password" && child->getNamespace() == root->getNamespace()) { + getPayloadInternal()->setPassword(child->getText()); + } + else if (child->getName() == "invite" && child->getNamespace() == root->getNamespace()) { + MUCUserPayload::Invite invite; + std::string to = child->getAttributes().getAttribute("to"); + if (!to.empty()) { + invite.to = to; + } + std::string from = child->getAttributes().getAttribute("from"); + if (!from.empty()) { + invite.from = from; + } + ParserElement::ref reason = child->getChild("reason", root->getNamespace()); + if (reason) { + invite.reason = reason->getText(); + } + getPayloadInternal()->setInvite(invite); + } else if (child->getName() == "status" && child->getNamespace() == root->getNamespace()) { MUCUserPayload::StatusCode status; try { |