diff options
-rw-r--r-- | protocols/SkypeWeb/src/skype_avatars.cpp | 9 | ||||
-rw-r--r-- | 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);
}
|