From 8946d725ef85d8ebabcc1aff8c1c46577f29cd93 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 9 Apr 2015 08:16:03 +0000 Subject: fixed own avatar loading git-svn-id: http://svn.miranda-ng.org/main/trunk@12690 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_avatars.cpp | 9 ++++----- protocols/SkypeWeb/src/skype_login.cpp | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp index 0f792d5e2f..94b890fe74 100644 --- a/protocols/SkypeWeb/src/skype_avatars.cpp +++ b/protocols/SkypeWeb/src/skype_avatars.cpp @@ -44,9 +44,9 @@ void CSkypeProto::OnReceiveAvatar(const NETLIBHTTPREQUEST *response, void *arg) return; PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) }; - GetAvatarFileName(hContact, AI.filename, SIZEOF(AI.filename)); AI.format = ProtoGetBufferFormat(response->pData); - setByte(AI.hContact, "AvatarType", AI.format); + setByte(hContact, "AvatarType", AI.format); + GetAvatarFileName(hContact, AI.filename, SIZEOF(AI.filename)); FILE *out = _tfopen(AI.filename, _T("wb")); if (out == NULL) { @@ -78,13 +78,12 @@ INT_PTR CSkypeProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam) if (szUrl == NULL) return GAIR_NOAVATAR; + AI->format = getByte(AI->hContact, "AvatarType", PA_FORMAT_JPEG); + TCHAR tszFileName[MAX_PATH]; GetAvatarFileName(AI->hContact, tszFileName, SIZEOF(tszFileName)); _tcsncpy(AI->filename, tszFileName, SIZEOF(AI->filename)); - AI->format = ProtoGetAvatarFormat(AI->filename); - setByte(AI->hContact, "AvatarType", AI->format); - if (::_taccess(AI->filename, 0) == 0 && !getBool(AI->hContact, "NeedNewAvatar", 0)) return GAIR_SUCCESS; diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index ed0ac93cf4..d4c5e8b465 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -92,6 +92,8 @@ void CSkypeProto::OnLoginSecond(const NETLIBHTTPREQUEST *response) PushRequest(new CreateEndpointRequest(token.c_str()), &CSkypeProto::OnEndpointCreated); PushRequest(new GetProfileRequest(token.c_str()), &CSkypeProto::LoadProfile); + ptrA szUrl(getStringA("AvatarUrl")); + PushRequest(new GetAvatarRequest(szUrl), &CSkypeProto::OnReceiveAvatar, NULL); PushRequest(new GetContactListRequest(token.c_str()), &CSkypeProto::LoadContactList); } -- cgit v1.2.3