diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-07-13 20:40:40 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-07-13 20:43:34 (GMT) |
commit | 7f9c693b3d90ebd5bbb7a99d99ba0dc6213dcb47 (patch) | |
tree | 8c332e98b7fbfeeee6df5c82f3cdd2307db4008f /Swiften/Serializer/PayloadSerializers | |
parent | 43eadfb5d884407c54ccd41cf46881ae374fdf15 (diff) | |
download | swift-contrib-7f9c693b3d90ebd5bbb7a99d99ba0dc6213dcb47.zip swift-contrib-7f9c693b3d90ebd5bbb7a99d99ba0dc6213dcb47.tar.bz2 |
Implement a clean full login procedure.
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp | 8 |
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(); } |