summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-09-09 13:20:18 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-09-11 21:53:44 (GMT)
commit904db4e398210192093b688ebf1ad66fb017b6d2 (patch)
tree083f01449f64dc27aff63e2be0aa00a73cbd511b /Swiften/Avatars/AvatarManager.cpp
parent10d8ba50a9e09517cfe4a6d4c3d51a768e989125 (diff)
downloadswift-contrib-904db4e398210192093b688ebf1ad66fb017b6d2.zip
swift-contrib-904db4e398210192093b688ebf1ad66fb017b6d2.tar.bz2
Added CombinedAvatarProvider
Diffstat (limited to 'Swiften/Avatars/AvatarManager.cpp')
-rw-r--r--Swiften/Avatars/AvatarManager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Swiften/Avatars/AvatarManager.cpp b/Swiften/Avatars/AvatarManager.cpp
index 9c3255d..6811a8e 100644
--- a/Swiften/Avatars/AvatarManager.cpp
+++ b/Swiften/Avatars/AvatarManager.cpp
@@ -15,15 +15,17 @@ namespace Swift {
AvatarManager::AvatarManager(VCardManager* vcardManager, StanzaChannel* stanzaChannel, AvatarStorage* avatarStorage, MUCRegistry* mucRegistry) : avatarStorage(avatarStorage) {
vcardUpdateAvatarManager = new VCardUpdateAvatarManager(vcardManager, stanzaChannel, avatarStorage, mucRegistry);
- vcardUpdateAvatarManager->onAvatarChanged.connect(boost::ref(onAvatarChanged));
+ combinedAvatarProvider.addProvider(vcardUpdateAvatarManager);
+ combinedAvatarProvider.onAvatarChanged.connect(boost::ref(onAvatarChanged));
}
AvatarManager::~AvatarManager() {
+ combinedAvatarProvider.removeProvider(vcardUpdateAvatarManager);
delete vcardUpdateAvatarManager;
}
boost::filesystem::path AvatarManager::getAvatarPath(const JID& jid) const {
- String hash = vcardUpdateAvatarManager->getAvatarHash(jid);
+ String hash = combinedAvatarProvider.getAvatarHash(jid);
if (!hash.isEmpty()) {
return avatarStorage->getAvatarPath(hash);
}