summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/DeliveryReceiptParser.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/DeliveryReceiptParser.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/DeliveryReceiptParser.cpp b/Swiften/Parser/PayloadParsers/DeliveryReceiptParser.cpp
new file mode 100644
index 0000000..347200d
--- /dev/null
+++ b/Swiften/Parser/PayloadParsers/DeliveryReceiptParser.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2011 Tobias Markmann
+ * Licensed under the BSD license.
+ * See http://www.opensource.org/licenses/bsd-license.php for more information.
+ */
+
+#include <Swiften/Parser/PayloadParsers/DeliveryReceiptParser.h>
+
+#include <boost/optional.hpp>
+
+namespace Swift {
+
+DeliveryReceiptParser::DeliveryReceiptParser() : level_(0) {
+}
+
+void DeliveryReceiptParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributeMap) {
+ if (level_ == 0) {
+ if (element == "received") {
+ if (attributeMap.getAttributeValue("id").is_initialized()) {
+ getPayloadInternal()->setReceivedID(attributeMap.getAttributeValue("id").get());
+ }
+ }
+ }
+ ++level_;
+}
+
+void DeliveryReceiptParser::handleEndElement(const std::string&, const std::string&) {
+ --level_;
+}
+
+void DeliveryReceiptParser::handleCharacterData(const std::string&) {
+
+}
+
+}