summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-21 14:28:10 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-21 14:28:10 (GMT)
commitf4f175051b0c95edad200d66fa12f1b9511e2c6b (patch)
treeacdc080d28b7060a82874b80fffd2e19c168a229
parent0a2180bdf1f435178ce9ea547e077b4753d50394 (diff)
downloadswift-contrib-f4f175051b0c95edad200d66fa12f1b9511e2c6b.zip
swift-contrib-f4f175051b0c95edad200d66fa12f1b9511e2c6b.tar.bz2
Serialize link local vcard to disk.
-rw-r--r--Slimber/FileVCardCollection.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Slimber/FileVCardCollection.cpp b/Slimber/FileVCardCollection.cpp
index 1568b33..16c53c4 100644
--- a/Slimber/FileVCardCollection.cpp
+++ b/Slimber/FileVCardCollection.cpp
@@ -1,5 +1,9 @@
#include "Slimber/FileVCardCollection.h"
+
+#include <boost/filesystem/fstream.hpp>
+
#include "Swiften/Elements/VCard.h"
+#include "Swiften/Serializer/PayloadSerializers/VCardSerializer.h"
namespace Swift {
@@ -12,7 +16,9 @@ boost::shared_ptr<VCard> FileVCardCollection::getOwnVCard() const {
}
void FileVCardCollection::setOwnVCard(boost::shared_ptr<VCard> v) {
- vcard = v;
+ boost::filesystem::ofstream file(vcardsPath / std::string("vcard.xml"));
+ file << VCardSerializer().serializePayload(v);
+ file.close();
}
}