summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/MIXParticipantParser.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/MIXParticipantParser.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/MIXParticipantParser.cpp b/Swiften/Parser/PayloadParsers/MIXParticipantParser.cpp
new file mode 100644
index 0000000..0ab2b87
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/MIXParticipantParser.cpp
@@ -0,0 +1,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);
+ }
+ }
+ }
+}
+
+}