summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-11-24 18:06:18 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-11-24 18:06:18 +0000
commita1e277b0481a00d7865b2278a83c3830b2e083a3 (patch)
tree78683f978e921d84acff713e8892d50d72decbbf /protocols
parent09e11d659eae5880041e0cc051d42dfbcc498695 (diff)
fixed redownloading avatars if they were deleted
git-svn-id: http://svn.miranda-ng.org/main/trunk@2471 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Skype/src/skype_contacts.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp
index b15e383405..b3a59f50ac 100644
--- a/protocols/Skype/src/skype_contacts.cpp
+++ b/protocols/Skype/src/skype_contacts.cpp
@@ -44,9 +44,10 @@ void CSkypeProto::UpdateContactAvatar(HANDLE hContact, CContact::Ref contact)
DWORD oldTS = this->GetSettingDword(hContact, "AvatarTS");
SEBinary data;
contact->GetPropAvatarImage(data);
- if ((newTS > oldTS) || (!newTS && data.size() > 0)) //hack for avatars without timestamp
+ wchar_t *path = this->GetContactAvatarFilePath(hContact);
+ int ttt = _waccess(path, 0);
+ if ((newTS > oldTS) || (!newTS && data.size() > 0 && _waccess(path, 0) == -1) || (newTS && _waccess(path, 0) == -1)) //hack for avatars without timestamp
{
- wchar_t *path = this->GetContactAvatarFilePath(hContact);
FILE* fp = _wfopen(path, L"wb");
if (fp)
{
@@ -63,8 +64,8 @@ void CSkypeProto::UpdateContactAvatar(HANDLE hContact, CContact::Ref contact)
this->SendBroadcast(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&pai, 0);
}
- delete path;
}
+ delete path;
}
void CSkypeProto::UpdateContactBirthday(HANDLE hContact, CContact::Ref contact)