summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_profile.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-11-25 11:08:37 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-11-25 11:08:37 +0000
commite027d86c08e0b00e33152f2541bf58875bad8a51 (patch)
treed4bd547afe1dfe66b7ec44f0e1db60b9ffa6f260 /protocols/Skype/src/skype_profile.cpp
parent22c73a4ca5c842cc18ca9b45aa4b883d59d84012 (diff)
fixed getting of own avatar
git-svn-id: http://svn.miranda-ng.org/main/trunk@2475 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_profile.cpp')
-rw-r--r--protocols/Skype/src/skype_profile.cpp42
1 files changed, 19 insertions, 23 deletions
diff --git a/protocols/Skype/src/skype_profile.cpp b/protocols/Skype/src/skype_profile.cpp
index a5854ab9ff..eede0e216e 100644
--- a/protocols/Skype/src/skype_profile.cpp
+++ b/protocols/Skype/src/skype_profile.cpp
@@ -2,36 +2,32 @@
void CSkypeProto::UpdateOwnAvatar()
{
- /*uint newTS = 0;
+ uint newTS = 0;
this->account->GetPropAvatarTimestamp(newTS);
DWORD oldTS = this->GetSettingDword("AvatarTS");
- if (newTS > oldTS)
+ wchar_t *path = this->GetContactAvatarFilePath(NULL);
+ SEBinary data;
+ this->account->GetPropAvatarImage(data);
+ if ((newTS > oldTS) || (!newTS && data.size() > 0 && _waccess(path, 0) == -1) || (newTS && _waccess(path, 0) == -1)) //hack for avatars without timestamp
{
- SEBinary data;
- this->account->GetPropAvatarImage(data);
-
- if (data.size() > 0)
+ FILE* fp = _wfopen(path, L"wb");
+ if (fp)
{
- wchar_t *path = this->GetContactAvatarFilePath(NULL);
- FILE* fp = _wfopen(path, L"wb");
- if (fp)
- {
- fwrite(data.data(), sizeof(char), data.size(), fp);
- fclose(fp);
+ fwrite(data.data(), sizeof(char), data.size(), fp);
+ fclose(fp);
- this->SetSettingDword("AvatarTS", newTS);
+ this->SetSettingDword("AvatarTS", newTS);
- PROTO_AVATAR_INFORMATIONW pai = {0};
- pai.cbSize = sizeof(pai);
- pai.format = PA_FORMAT_JPEG;
- pai.hContact = NULL;
- wcscpy(pai.filename, path);
+ PROTO_AVATAR_INFORMATIONW pai = {0};
+ pai.cbSize = sizeof(pai);
+ pai.format = PA_FORMAT_JPEG;
+ pai.hContact = NULL;
+ wcscpy(pai.filename, path);
- this->SendBroadcast(ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&pai, 0);
- }
- delete path;
- }
- }*/
+ this->SendBroadcast(ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&pai, 0);
+ }
+ delete path;
+ }
}
void CSkypeProto::UpdateOwnBirthday()