summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_avatars.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-05-27 16:11:15 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-05-27 16:11:15 +0300
commit49e856bee9b637156e659dcf0e65180dd5a4e077 (patch)
tree7c753bc2bdeda08956101d1b4604ec063989c2a8 /protocols/SkypeWeb/src/skype_avatars.cpp
parent59bcd6091e2332308e4aac5a05d3b719f15aa031 (diff)
SkypeWeb:
- massive code cleanup, old http junk wiped out & replaced with standard MHttpRequest class - old MS login code removed; - basic url replaced with modern one;
Diffstat (limited to 'protocols/SkypeWeb/src/skype_avatars.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_avatars.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp
index ad4e9646d8..0a59a52631 100644
--- a/protocols/SkypeWeb/src/skype_avatars.cpp
+++ b/protocols/SkypeWeb/src/skype_avatars.cpp
@@ -52,12 +52,12 @@ void CSkypeProto::ReloadAvatarInfo(MCONTACT hContact)
SvcGetAvatarInfo(0, (LPARAM)&ai);
}
-void CSkypeProto::OnReceiveAvatar(const NETLIBHTTPREQUEST *response, void *arg)
+void CSkypeProto::OnReceiveAvatar(NETLIBHTTPREQUEST *response, AsyncHttpRequest *pRequest)
{
if (response == nullptr || response->pData == nullptr)
return;
- MCONTACT hContact = (DWORD_PTR)arg;
+ MCONTACT hContact = (DWORD_PTR)pRequest->pUserInfo;
if (response->resultCode != 200)
return;
@@ -78,7 +78,7 @@ void CSkypeProto::OnReceiveAvatar(const NETLIBHTTPREQUEST *response, void *arg)
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai, 0);
}
-void CSkypeProto::OnSentAvatar(const NETLIBHTTPREQUEST *response)
+void CSkypeProto::OnSentAvatar(NETLIBHTTPREQUEST *response, AsyncHttpRequest*)
{
JsonReply root(response);
if (root.error())
@@ -103,7 +103,7 @@ INT_PTR CSkypeProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam)
return GAIR_SUCCESS;
if (IsOnline()) {
- PushRequest(new GetAvatarRequest(szUrl), &CSkypeProto::OnReceiveAvatar, (void*)pai->hContact);
+ PushRequest(new GetAvatarRequest(szUrl, pai->hContact));
debugLogA("Requested to read an avatar from '%s'", szUrl.get());
return GAIR_WAITFOR;
}
@@ -174,7 +174,7 @@ INT_PTR CSkypeProto::SvcSetMyAvatar(WPARAM, LPARAM lParam)
if (data != NULL && fread(data, sizeof(BYTE), length, hFile) == length) {
const char *szMime = FreeImage_GetFIFMimeType(FreeImage_GetFIFFromFilenameU(path));
- PushRequest(new SetAvatarRequest(data, length, szMime, this), &CSkypeProto::OnSentAvatar);
+ PushRequest(new SetAvatarRequest(data, length, szMime, this));
fclose(hFile);
return 0;
}