summaryrefslogtreecommitdiffstats
blob: 0a49a4ba6fb0f699022bf25d5a12520a6b01eac6 (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
/*
 * Copyright (c) 2014 Kevin Smith and Remko Tronçon
 * Licensed under the GNU General Public License v3.
 * See Documentation/Licenses/GPLv3.txt for more information.
 */

#include <boost/lexical_cast.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Serializer/XML/XMLElement.h>
#include <Swiften/Serializer/XML/XMLRawTextNode.h>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
#include <Swiften/Serializer/PayloadSerializers/MAMArchivedSerializer.h>

using namespace Swift;

MAMArchivedSerializer::MAMArchivedSerializer() {
}

MAMArchivedSerializer::~MAMArchivedSerializer() {
}

std::string MAMArchivedSerializer::serializePayload(boost::shared_ptr<MAMArchived> payload) const {
	if (!payload) {
		return "";
	}

	XMLElement element("archived", "urn:xmpp:mam:0");
	element.setAttribute("by", payload->getBy());
	element.setAttribute("id", payload->getID());

	return element.serialize();
}