summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Avatars/AvatarManager.cpp')
-rw-r--r--Swiften/Avatars/AvatarManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/Avatars/AvatarManager.cpp b/Swiften/Avatars/AvatarManager.cpp
index c15d002..6a1efc6 100644
--- a/Swiften/Avatars/AvatarManager.cpp
+++ b/Swiften/Avatars/AvatarManager.cpp
@@ -49,6 +49,12 @@ void AvatarManager::handleVCardReceived(const JID& from, const String& promisedH
setAvatarHash(from, realHash);
}
+void AvatarManager::setAvatar(const JID& jid, const ByteArray& avatar) {
+ String hash = SHA1::getHexHash(avatar);
+ avatarStorage_->addAvatar(hash, avatar);
+ setAvatarHash(getAvatarJID(jid), hash);
+}
+
void AvatarManager::setAvatarHash(const JID& from, const String& hash) {
avatarHashes_[from] = hash;
onAvatarChanged(from, hash);