From a1e277b0481a00d7865b2278a83c3830b2e083a3 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 24 Nov 2012 18:06:18 +0000 Subject: fixed redownloading avatars if they were deleted git-svn-id: http://svn.miranda-ng.org/main/trunk@2471 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_contacts.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'protocols/Skype') 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) -- cgit v1.2.3