summaryrefslogtreecommitdiffstats
blob: 30a283ef4e286b2dd6ad5ad58c0b67a219610d82 (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
/*
 * Copyright (c) 2015 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#include <Swiften/Serializer/PayloadSerializers/CarbonsSentSerializer.h>

namespace Swift {
	CarbonsSentSerializer::CarbonsSentSerializer(PayloadSerializerCollection* serializers) : GenericPayloadSerializer<CarbonsSent>(), serializers_(serializers) {
	}

	CarbonsSentSerializer::~CarbonsSentSerializer() {
	}
	
	std::string CarbonsSentSerializer::serializePayload(boost::shared_ptr<CarbonsSent> sent) const {
		XMLElement element("sent", "urn:xmpp:carbons:2");
		if (sent->getForwarded()) {
			element.addNode(boost::make_shared<XMLRawTextNode>(ForwardedSerializer(serializers_).serialize(sent->getForwarded())));
		}
		return element.serialize();
	}
}