summaryrefslogtreecommitdiff
path: root/plugins/AVS/src/cache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AVS/src/cache.cpp')
-rw-r--r--plugins/AVS/src/cache.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp
index 11d8620b02..bb04abaf2d 100644
--- a/plugins/AVS/src/cache.cpp
+++ b/plugins/AVS/src/cache.cpp
@@ -90,10 +90,23 @@ CacheNode* FindAvatarInCache(MCONTACT hContact, bool add, bool findAny)
cc->hContact = hContact;
arCache.insert(cc);
- PushAvatarRequest(cc);
+ switch (CreateAvatarInCache(hContact, cc, nullptr)) {
+ case -2: // no avatar data in settings, retrieve
+ PushAvatarRequest(cc);
+ SetEvent(hLoaderEvent); // wake him up
+ break;
+
+ case 1: // loaded, everything is ok
+ if (cc->hbmPic != nullptr)
+ cc->loaded = true;
+ break;
+
+ default:
+ cc->loaded = false;
+ break;
+ }
- SetEvent(hLoaderEvent); // wake him up
- return nullptr;
+ return cc;
}
// output a notification message.