summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-08 18:29:21 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-04-08 19:10:22 (GMT)
commit5bdea1948a15eb14ee64a6b480d2aeac3b9c8fbd (patch)
tree3f50325cd06be850edcd6ec190268a737eb88259 /Swiften/VCards
parenta7c9f8c93327b4e7176b1ec0588867f8609f84fa (diff)
downloadswift-contrib-5bdea1948a15eb14ee64a6b480d2aeac3b9c8fbd.zip
swift-contrib-5bdea1948a15eb14ee64a6b480d2aeac3b9c8fbd.tar.bz2
Added copyrights to Swiften.
Diffstat (limited to 'Swiften/VCards')
-rw-r--r--Swiften/VCards/VCardManager.cpp22
-rw-r--r--Swiften/VCards/VCardManager.h28
2 files changed, 50 insertions, 0 deletions
diff --git a/Swiften/VCards/VCardManager.cpp b/Swiften/VCards/VCardManager.cpp
new file mode 100644
index 0000000..0174dea
--- /dev/null
+++ b/Swiften/VCards/VCardManager.cpp
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include "Swiften/VCards/VCardManager.h"
+
+namespace Swift {
+
+VCardManager::VCardManager(IQRouter* iqRouter, VCardStorage* vcardStorage) : iqRouter(iqRouter), storage(vcardStorage) {
+}
+
+boost::shared_ptr<VCard> VCardManager::getVCardAndRequestWhenNeeded(const JID& jid) const {
+ boost::shared_ptr<VCard> vcard = storage->getVCard(jid);
+ if (!vcard) {
+ // TODO: Request vcard if necessary
+ }
+ return vcard;
+}
+
+}
diff --git a/Swiften/VCards/VCardManager.h b/Swiften/VCards/VCardManager.h
new file mode 100644
index 0000000..bbf07c0
--- /dev/null
+++ b/Swiften/VCards/VCardManager.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include "Swiften/Elements/VCard.h"
+
+namespace Swift {
+ class JID;
+ class VCardStorage;
+
+ class VCardManager {
+ public:
+ VCardManager(IQRouter* iqRouter, VCardStorage* vcardStorage);
+
+ virtual boost::shared_ptr<VCard> getVCardAndRequestWhenNeeded(const JID& jid) const ;
+
+ public:
+ boost::signal<void (const JID&)> onVCardChanged;
+
+ private:
+ IQRouter* iqRouter;
+ VCardStorage* storage;
+ };
+}