summaryrefslogtreecommitdiffstats
blob: 71ad9a248883413c2b930ec8d19ed0aa2237d183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "Swiften/Serializer/PayloadSerializers/SoftwareVersionSerializer.h"

namespace Swift {

SoftwareVersionSerializer::SoftwareVersionSerializer() : GenericPayloadSerializer<SoftwareVersion>() {
}

String SoftwareVersionSerializer::serializePayload(boost::shared_ptr<SoftwareVersion> version)  const {
	String result("<query xmlns=\"jabber:iq:version\">");
	if (!version->getName().isEmpty()) {
		result += "<name>" + version->getName() + "</name>";
	}
	if (!version->getVersion().isEmpty()) {
		result += "<version>" + version->getVersion() + "</version>";
	}
	if (!version->getOS().isEmpty()) {
		result += "<os>" + version->getOS() + "</os>";
	}
	result += "</query>";
	return result;
}

}