summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Avatars/AvatarManager.cpp')
-rw-r--r--Swiften/Avatars/AvatarManager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Swiften/Avatars/AvatarManager.cpp b/Swiften/Avatars/AvatarManager.cpp
index 6811a8e..6ad39fb 100644
--- a/Swiften/Avatars/AvatarManager.cpp
+++ b/Swiften/Avatars/AvatarManager.cpp
@@ -9,6 +9,7 @@
#include <boost/bind.hpp>
#include "Swiften/Avatars/VCardUpdateAvatarManager.h"
+#include "Swiften/Avatars/VCardAvatarManager.h"
#include "Swiften/Avatars/AvatarStorage.h"
namespace Swift {
@@ -16,10 +17,16 @@ namespace Swift {
AvatarManager::AvatarManager(VCardManager* vcardManager, StanzaChannel* stanzaChannel, AvatarStorage* avatarStorage, MUCRegistry* mucRegistry) : avatarStorage(avatarStorage) {
vcardUpdateAvatarManager = new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, mucRegistry);
combinedAvatarProvider.addProvider(vcardUpdateAvatarManager);
+
+ vcardAvatarManager = new VCardAvatarManager(vcardManager, avatarStorage, mucRegistry);
+ combinedAvatarProvider.addProvider(vcardAvatarManager);
+
combinedAvatarProvider.onAvatarChanged.connect(boost::ref(onAvatarChanged));
}
AvatarManager::~AvatarManager() {
+ combinedAvatarProvider.removeProvider(vcardAvatarManager);
+ delete vcardAvatarManager;
combinedAvatarProvider.removeProvider(vcardUpdateAvatarManager);
delete vcardUpdateAvatarManager;
}
@@ -27,6 +34,7 @@ AvatarManager::~AvatarManager() {
boost::filesystem::path AvatarManager::getAvatarPath(const JID& jid) const {
String hash = combinedAvatarProvider.getAvatarHash(jid);
if (!hash.isEmpty()) {
+ std::cout << "getAvatar " << jid << " " << avatarStorage->getAvatarPath(hash) << std::endl;
return avatarStorage->getAvatarPath(hash);
}
return boost::filesystem::path();