Changeset - bcf60737f919
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-11-14 16:14:30
hanzz.k@gmail.com
Don't send empty units/values in stats payload
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
include/Swiften/Serializer/PayloadSerializers/StatsSerializer.cpp
Show inline comments
 
@@ -23,8 +23,12 @@ std::string StatsSerializer::serializePayload(boost::shared_ptr<StatsPayload> st
 
	foreach(const StatsPayload::Item& item, stats->getItems()) {
 
		boost::shared_ptr<XMLElement> statElement(new XMLElement("stat"));
 
		statElement->setAttribute("name", item.getName());
 
		statElement->setAttribute("units", item.getUnits());
 
		statElement->setAttribute("value", item.getValue());
 
		if (!item.getUnits().empty()) {
 
			statElement->setAttribute("units", item.getUnits());
 
		}
 
		if (!item.getUnits().empty()) {
 
			statElement->setAttribute("value", item.getUnits());
 
		}
 

	
 
		queryElement.addNode(statElement);
 
	}
0 comments (0 inline, 0 general)