summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-06-20 11:47:21 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-06-20 14:38:58 (GMT)
commit6eb30e0e1f0a8e7ee936f3c006c7f710785653df (patch)
tree1e72dd6445d7d8d4e06f71c52299260a941a5be6 /Swiften/Serializer
parent6d50c38e2bc6a17afb19effe06d2103f06c8ea1c (diff)
downloadswift-contrib-6eb30e0e1f0a8e7ee936f3c006c7f710785653df.zip
swift-contrib-6eb30e0e1f0a8e7ee936f3c006c7f710785653df.tar.bz2
Added vCard-based avatars support.
Diffstat (limited to 'Swiften/Serializer')
-rw-r--r--Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp2
-rw-r--r--Swiften/Serializer/PayloadSerializers/Makefile.inc3
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp18
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardSerializer.h13
4 files changed, 35 insertions, 1 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp
index 9799802..f9a0789 100644
--- a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp
+++ b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.cpp
@@ -15,6 +15,7 @@
#include "Swiften/Serializer/PayloadSerializers/StartSessionSerializer.h"
#include "Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.h"
#include "Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.h"
+#include "Swiften/Serializer/PayloadSerializers/VCardSerializer.h"
namespace Swift {
@@ -33,6 +34,7 @@ FullPayloadSerializerCollection::FullPayloadSerializerCollection() {
serializers_.push_back(new StartSessionSerializer());
serializers_.push_back(new SecurityLabelSerializer());
serializers_.push_back(new SecurityLabelsCatalogSerializer());
+ serializers_.push_back(new VCardSerializer());
foreach(PayloadSerializer* serializer, serializers_) {
addSerializer(serializer);
}
diff --git a/Swiften/Serializer/PayloadSerializers/Makefile.inc b/Swiften/Serializer/PayloadSerializers/Makefile.inc
index 61f603a..893da6c 100644
--- a/Swiften/Serializer/PayloadSerializers/Makefile.inc
+++ b/Swiften/Serializer/PayloadSerializers/Makefile.inc
@@ -8,6 +8,7 @@ SWIFTEN_SOURCES += \
Swiften/Serializer/PayloadSerializers/CapsInfoSerializer.cpp \
Swiften/Serializer/PayloadSerializers/ResourceBindSerializer.cpp \
Swiften/Serializer/PayloadSerializers/SecurityLabelSerializer.cpp \
- Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp
+ Swiften/Serializer/PayloadSerializers/SecurityLabelsCatalogSerializer.cpp \
+ Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp
include Swiften/Serializer/PayloadSerializers/UnitTest/Makefile.inc
diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp
new file mode 100644
index 0000000..ce4e399
--- /dev/null
+++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.cpp
@@ -0,0 +1,18 @@
+#include "Swiften/Serializer/PayloadSerializers/VCardSerializer.h"
+
+#include <boost/shared_ptr.hpp>
+
+#include "Swiften/Serializer/XML/XMLElement.h"
+
+namespace Swift {
+
+VCardSerializer::VCardSerializer() : GenericPayloadSerializer<VCard>() {
+}
+
+String VCardSerializer::serializePayload(boost::shared_ptr<VCard> discoInfo) const {
+ XMLElement queryElement("vCard", "vcard-temp");
+ // TODO
+ return queryElement.serialize();
+}
+
+}
diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.h b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
new file mode 100644
index 0000000..baf5947
--- /dev/null
+++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "Swiften/Serializer/GenericPayloadSerializer.h"
+#include "Swiften/Elements/VCard.h"
+
+namespace Swift {
+ class VCardSerializer : public GenericPayloadSerializer<VCard> {
+ public:
+ VCardSerializer();
+
+ virtual String serializePayload(boost::shared_ptr<VCard>) const;
+ };
+}