summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/avatars.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-06-10 21:18:00 +0000
committerRobert Pösel <robyer@seznam.cz>2012-06-10 21:18:00 +0000
commit4ad68f3d27feb1307e76c0cf25617a0bcf9de507 (patch)
treecbb938c4d502c6b4d6f30e5903a5c8e8a141b6b4 /protocols/FacebookRM/avatars.cpp
parent2430d726d4585347c31c1a4b1c42023aa6d6ee8e (diff)
FacebookRM sync
git-svn-id: http://svn.miranda-ng.org/main/trunk@385 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/avatars.cpp')
-rw-r--r--protocols/FacebookRM/avatars.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/protocols/FacebookRM/avatars.cpp b/protocols/FacebookRM/avatars.cpp
index a316d9fe68..6b7e735c29 100644
--- a/protocols/FacebookRM/avatars.cpp
+++ b/protocols/FacebookRM/avatars.cpp
@@ -180,11 +180,19 @@ int FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
if (!lParam)
return GAIR_NOAVATAR;
- PROTO_AVATAR_INFORMATION* AI = ( PROTO_AVATAR_INFORMATION* )lParam;
+ PROTO_AVATAR_INFORMATION* AI = (PROTO_AVATAR_INFORMATION*)lParam;
if (GetDbAvatarInfo(*AI, NULL))
{
- if (_access(AI->filename, 0) || (wParam & GAIF_FORCE))
+ bool fileExist = _access(AI->filename, 0) == 0;
+
+ bool needLoad;
+ if (AI->hContact)
+ needLoad = (wParam & GAIF_FORCE) && (!fileExist || DBGetContactSettingByte(AI->hContact, "ContactPhoto", "NeedUpdate", 0));
+ else
+ needLoad = (wParam & GAIF_FORCE) || !fileExist;
+
+ if (needLoad)
{
LOG("***** Starting avatar request thread for %s", AI->filename);
ScopedLock s( avatar_lock_ );
@@ -196,12 +204,11 @@ int FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
if (is_empty)
ForkThread(&FacebookProto::UpdateAvatarWorker, this, NULL);
}
-
return GAIR_WAITFOR;
}
+ else if (fileExist)
+ return GAIR_SUCCESS;
- LOG("***** Giving AvatarInfo: %s", AI->filename);
- return GAIR_SUCCESS;
}
return GAIR_NOAVATAR;
}