diff options
Diffstat (limited to 'Swiften/Avatars/VCardUpdateAvatarManager.cpp')
-rw-r--r-- | Swiften/Avatars/VCardUpdateAvatarManager.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Swiften/Avatars/VCardUpdateAvatarManager.cpp b/Swiften/Avatars/VCardUpdateAvatarManager.cpp index 9d0ae2d..c830b54 100644 --- a/Swiften/Avatars/VCardUpdateAvatarManager.cpp +++ b/Swiften/Avatars/VCardUpdateAvatarManager.cpp @@ -25,10 +25,6 @@ VCardUpdateAvatarManager::VCardUpdateAvatarManager(VCardManager* vcardManager, S vcardManager_->onVCardChanged.connect(boost::bind(&VCardUpdateAvatarManager::handleVCardChanged, this, _1, _2)); } -VCardUpdateAvatarManager::~VCardUpdateAvatarManager() { - -} - void VCardUpdateAvatarManager::handlePresenceReceived(boost::shared_ptr<Presence> presence) { boost::shared_ptr<VCardUpdate> update = presence->getPayload<VCardUpdate>(); if (!update || presence->getPayload<ErrorPayload>()) { @@ -57,7 +53,9 @@ void VCardUpdateAvatarManager::handleVCardChanged(const JID& from, VCard::ref vC } else { String hash = Hexify::hexify(SHA1::getHash(vCard->getPhoto())); - avatarStorage_->addAvatar(hash, vCard->getPhoto()); + if (!avatarStorage_->hasAvatar(hash)) { + avatarStorage_->addAvatar(hash, vCard->getPhoto()); + } setAvatarHash(from, hash); } } |