summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer')
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp
index 4e1a762..26e1623 100644
--- a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp
@@ -3,14 +3,20 @@
#include <boost/shared_ptr.hpp>
#include "Swiften/Serializer/XML/XMLElement.h"
+#include "Swiften/Serializer/XML/XMLTextNode.h"
namespace Swift {
VCardSerializer::VCardSerializer() : GenericPayloadSerializer<VCard>() {
}
-String VCardSerializer::serializePayload(boost::shared_ptr<VCard>) const {
+String VCardSerializer::serializePayload(boost::shared_ptr<VCard> vcard) const {
XMLElement queryElement("vCard", "vcard-temp");
+ if (!vcard->getNickname().isEmpty()) {
+ boost::shared_ptr<XMLElement> nickElement(new XMLElement("NICKNAME"));
+ nickElement->addNode(boost::shared_ptr<XMLTextNode>(new XMLTextNode(vcard->getNickname())));
+ queryElement.addNode(nickElement);
+ }
// TODO
return queryElement.serialize();
}