summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Avatars/VCardUpdateAvatarManager.cpp')
-rw-r--r--Swiften/Avatars/VCardUpdateAvatarManager.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/Swiften/Avatars/VCardUpdateAvatarManager.cpp b/Swiften/Avatars/VCardUpdateAvatarManager.cpp
index dbc0b9b..24abfa1 100644
--- a/Swiften/Avatars/VCardUpdateAvatarManager.cpp
+++ b/Swiften/Avatars/VCardUpdateAvatarManager.cpp
@@ -52,9 +52,14 @@ void VCardUpdateAvatarManager::handleVCardChanged(const JID& from, VCard::ref vC
return;
}
- String hash = Hexify::hexify(SHA1::getHash(vCard->getPhoto()));
- avatarStorage_->addAvatar(hash, vCard->getPhoto());
- setAvatarHash(from, hash);
+ if (vCard->getPhoto().isEmpty()) {
+ setAvatarHash(from, "");
+ }
+ else {
+ String hash = Hexify::hexify(SHA1::getHash(vCard->getPhoto()));
+ avatarStorage_->addAvatar(hash, vCard->getPhoto());
+ setAvatarHash(from, hash);
+ }
}
void VCardUpdateAvatarManager::setAvatarHash(const JID& from, const String& hash) {