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

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

#include <boost/shared_ptr.hpp>

#include <Swiften/Serializer/XML/XMLElement.h>

namespace Swift {

CapsInfoSerializer::CapsInfoSerializer() : GenericPayloadSerializer<CapsInfo>() {
}

std::string CapsInfoSerializer::serializePayload(boost::shared_ptr<CapsInfo> capsInfo)  const {
	XMLElement capsElement("c", "http://jabber.org/protocol/caps");
	capsElement.setAttribute("node", capsInfo->getNode());
	capsElement.setAttribute("hash", capsInfo->getHash());
	capsElement.setAttribute("ver", capsInfo->getVersion());
	return capsElement.serialize();
}

}