summaryrefslogtreecommitdiffstats
blob: 347200d1384028f7f20ac4392b74a080957bd23f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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&) {

}

}