summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/MIXSetNickParser.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/MIXSetNickParser.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/MIXSetNickParser.cpp b/Swiften/Parser/PayloadParsers/MIXSetNickParser.cpp
new file mode 100644
index 0000000..34fec70
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/MIXSetNickParser.cpp
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include <Swiften/Parser/PayloadParsers/MIXSetNickParser.h>
+
+namespace Swift {
+
+void MIXSetNickParser::handleTree(ParserElement::ref root) {
+ for (const auto& child : root->getAllChildren()) {
+ if (child->getName() == "nick" && child->getNamespace() == root->getNamespace()) {
+ getPayloadInternal()->setNick(child->getText());
+ }
+ }
+}
+
+}