summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_avatars.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-05 15:54:03 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-05 15:54:03 +0300
commit14c4e44a0a91e1ad701d4ae3c58185d25118e64e (patch)
tree50f36035466f355c74373e757bc00b6610ce6267 /protocols/SkypeWeb/src/skype_avatars.cpp
parent94667140aeb3886d22e4c1301423fe99aaf3fba4 (diff)
Netlib:
- NETLIBHTTPHEADER & NETLIBHTTPREQUEST obsoleted; - NETLIBHTTPREQUEST divided into MHttpRequest & MHttpResponse; - MHttpHeaders now manager headers both for MHttpRequest & MHttpResponse;
Diffstat (limited to 'protocols/SkypeWeb/src/skype_avatars.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_avatars.cpp12
1 files changed, 6 insertions, 6 deletions
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;
}