From 14c4e44a0a91e1ad701d4ae3c58185d25118e64e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 5 Jan 2024 15:54:03 +0300 Subject: Netlib: - NETLIBHTTPHEADER & NETLIBHTTPREQUEST obsoleted; - NETLIBHTTPREQUEST divided into MHttpRequest & MHttpResponse; - MHttpHeaders now manager headers both for MHttpRequest & MHttpResponse; --- protocols/SkypeWeb/src/skype_avatars.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_avatars.cpp') diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp index 94d097c852..50c1207803 100644 --- a/protocols/SkypeWeb/src/skype_avatars.cpp +++ b/protocols/SkypeWeb/src/skype_avatars.cpp @@ -52,9 +52,9 @@ void CSkypeProto::ReloadAvatarInfo(MCONTACT hContact) SvcGetAvatarInfo(0, (LPARAM)&ai); } -void CSkypeProto::OnReceiveAvatar(NETLIBHTTPREQUEST *response, AsyncHttpRequest *pRequest) +void CSkypeProto::OnReceiveAvatar(MHttpResponse *response, AsyncHttpRequest *pRequest) { - if (response == nullptr || response->pData == nullptr) + if (response == nullptr || response->body.IsEmpty()) return; MCONTACT hContact = (DWORD_PTR)pRequest->pUserInfo; @@ -62,7 +62,7 @@ void CSkypeProto::OnReceiveAvatar(NETLIBHTTPREQUEST *response, AsyncHttpRequest return; PROTO_AVATAR_INFORMATION ai = { 0 }; - ai.format = ProtoGetBufferFormat(response->pData); + ai.format = ProtoGetBufferFormat(response->body); setByte(hContact, "AvatarType", ai.format); GetAvatarFileName(hContact, ai.filename, _countof(ai.filename)); @@ -72,13 +72,13 @@ void CSkypeProto::OnReceiveAvatar(NETLIBHTTPREQUEST *response, AsyncHttpRequest return; } - fwrite(response->pData, 1, response->dataLength, out); + fwrite(response->body, 1, response->body.GetLength(), out); fclose(out); setByte(hContact, "NeedNewAvatar", 0); ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai, 0); } -void CSkypeProto::OnSentAvatar(NETLIBHTTPREQUEST *response, AsyncHttpRequest*) +void CSkypeProto::OnSentAvatar(MHttpResponse *response, AsyncHttpRequest*) { JsonReply root(response); if (root.error()) @@ -175,7 +175,7 @@ INT_PTR CSkypeProto::SvcSetMyAvatar(WPARAM, LPARAM lParam) if (data != NULL && fread(data, sizeof(uint8_t), length, hFile) == length) { const char *szMime = FreeImage_GetFIFMimeType(FreeImage_GetFIFFromFilenameU(path)); - PushRequest(new SetAvatarRequest(data, length, szMime, this)); + PushRequest(new SetAvatarRequest(data, (int)length, szMime, this)); fclose(hFile); return 0; } -- cgit v1.2.3