summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/MIXSubscribeParser.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/MIXSubscribeParser.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/MIXSubscribeParser.cpp b/Swiften/Parser/PayloadParsers/MIXSubscribeParser.cpp
new file mode 100644
index 0000000..1500716
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/MIXSubscribeParser.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include <Swiften/Parser/PayloadParsers/MIXSubscribeParser.h>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Parser/PayloadParserFactory.h>
+#include <Swiften/Parser/PayloadParserFactoryCollection.h>
+
+using namespace Swift;
+
+MIXSubscribeParser::MIXSubscribeParser() : level_(0) {
+}
+
+MIXSubscribeParser::~MIXSubscribeParser() {
+}
+
+void MIXSubscribeParser::handleStartElement(const std::string&, const std::string&, const AttributeMap& attributes) {
+ if (level_ == 0) {
+ if (boost::optional<std::string> attributeValue = attributes.getAttributeValue("node")) {
+ getPayloadInternal()->setNode(*attributeValue);
+ }
+ }
+ ++level_;
+}
+
+void MIXSubscribeParser::handleEndElement(const std::string& , const std::string& ) {
+ --level_;
+}
+
+void MIXSubscribeParser::handleCharacterData(const std::string& ) {
+}