From 39047df03b5a2ffaa1f2e9896aca97d4feb068bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 19 Dec 2015 14:33:19 +0000 Subject: Steam: Fix wrong type of argument in callbacks (use HttpResponse instead of NETLIBHTTPREQUEST) git-svn-id: http://svn.miranda-ng.org/main/trunk@15892 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/http_request.h | 4 ++-- protocols/Steam/src/steam_contacts.cpp | 24 ++++++++++---------- protocols/Steam/src/steam_login.cpp | 8 +++---- protocols/Steam/src/steam_messages.cpp | 2 +- protocols/Steam/src/steam_proto.h | 40 +++++++++++++++++----------------- protocols/Steam/src/steam_request.cpp | 2 +- 6 files changed, 40 insertions(+), 40 deletions(-) (limited to 'protocols/Steam') diff --git a/protocols/Steam/src/http_request.h b/protocols/Steam/src/http_request.h index 30d1e307be..b4ec512e1a 100644 --- a/protocols/Steam/src/http_request.h +++ b/protocols/Steam/src/http_request.h @@ -152,11 +152,11 @@ public: }; -bool __forceinline ResponseHttpOk(const NETLIBHTTPREQUEST *response) { +bool __forceinline ResponseHttpOk(const HttpResponse *response) { return (response && response->pData && (response->resultCode == HTTP_CODE_OK)); } -bool __forceinline CheckResponse(const NETLIBHTTPREQUEST *response) { +bool __forceinline CheckResponse(const HttpResponse *response) { return (response && response->pData); } diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 907aece0fe..13e9a522c5 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -358,7 +358,7 @@ void CSteamProto::ProcessContact(std::map::iterator *it, } } -void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response) +void CSteamProto::OnGotFriendList(const HttpResponse *response) { if (!CheckResponse(response)) return; @@ -443,7 +443,7 @@ void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response) } } -void CSteamProto::OnGotBlockList(const NETLIBHTTPREQUEST *response) +void CSteamProto::OnGotBlockList(const HttpResponse *response) { if (!CheckResponse(response)) return; @@ -487,7 +487,7 @@ void CSteamProto::OnGotBlockList(const NETLIBHTTPREQUEST *response) } } -void CSteamProto::OnGotUserSummaries(const NETLIBHTTPREQUEST *response) +void CSteamProto::OnGotUserSummaries(const HttpResponse *response) { if (!CheckResponse(response)) return; @@ -522,7 +522,7 @@ void CSteamProto::OnGotUserSummaries(const NETLIBHTTPREQUEST *response) } } -void CSteamProto::OnGotAvatar(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnGotAvatar(const HttpResponse *response, void *arg) { PROTO_AVATAR_INFORMATION ai = { 0 }; ai.hContact = (UINT_PTR)arg; @@ -551,7 +551,7 @@ void CSteamProto::OnGotAvatar(const NETLIBHTTPREQUEST *response, void *arg) } } -void CSteamProto::OnFriendAdded(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnFriendAdded(const HttpResponse *response, void *arg) { SendAuthParam *param = (SendAuthParam*)arg; @@ -572,7 +572,7 @@ void CSteamProto::OnFriendAdded(const NETLIBHTTPREQUEST *response, void *arg) ProtoBroadcastAck(param->hContact, ACKTYPE_AUTHREQ, ACKRESULT_SUCCESS, param->hAuth, 0); } -void CSteamProto::OnFriendBlocked(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnFriendBlocked(const HttpResponse *response, void *arg) { if (!response || response->resultCode != HTTP_CODE_OK || lstrcmpiA(response->pData, "true")) { @@ -581,7 +581,7 @@ void CSteamProto::OnFriendBlocked(const NETLIBHTTPREQUEST *response, void *arg) } } -void CSteamProto::OnFriendRemoved(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnFriendRemoved(const HttpResponse *response, void *arg) { if (!response || response->resultCode != HTTP_CODE_OK || lstrcmpiA(response->pData, "true")) { @@ -593,7 +593,7 @@ void CSteamProto::OnFriendRemoved(const NETLIBHTTPREQUEST *response, void *arg) } } -void CSteamProto::OnAuthRequested(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnAuthRequested(const HttpResponse *response, void *arg) { if (!ResponseHttpOk(response)) { @@ -661,7 +661,7 @@ void CSteamProto::OnAuthRequested(const NETLIBHTTPREQUEST *response, void *arg) json_delete(nodes); } -void CSteamProto::OnPendingApproved(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnPendingApproved(const HttpResponse *response, void *arg) { if (!ResponseHttpOk(response)) { @@ -681,7 +681,7 @@ void CSteamProto::OnPendingApproved(const NETLIBHTTPREQUEST *response, void *arg } } -void CSteamProto::OnPendingIgnoreded(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnPendingIgnoreded(const HttpResponse *response, void *arg) { if (!ResponseHttpOk(response)) { @@ -701,7 +701,7 @@ void CSteamProto::OnPendingIgnoreded(const NETLIBHTTPREQUEST *response, void *ar } } -void CSteamProto::OnSearchByIdEnded(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnSearchByIdEnded(const HttpResponse *response, void *arg) { if (!ResponseHttpOk(response)) { @@ -756,7 +756,7 @@ void CSteamProto::OnSearchByIdEnded(const NETLIBHTTPREQUEST *response, void *arg json_delete(nodes); } -void CSteamProto::OnSearchByNameStarted(const NETLIBHTTPREQUEST *, void *) +void CSteamProto::OnSearchByNameStarted(const HttpResponse *, void *) { } diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp index c149f33eb1..9520bf0bd1 100644 --- a/protocols/Steam/src/steam_login.cpp +++ b/protocols/Steam/src/steam_login.cpp @@ -14,7 +14,7 @@ bool CSteamProto::IsMe(const char *steamId) return false; } -void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response) +void CSteamProto::OnGotRsaKey(const HttpResponse *response) { if (!CheckResponse(response)) return; @@ -73,7 +73,7 @@ void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response) &CSteamProto::OnAuthorization); } -void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response) +void CSteamProto::OnAuthorization(const HttpResponse *response) { if (!CheckResponse(response)) { @@ -227,7 +227,7 @@ void CSteamProto::OnAuthorizationSuccess(const JSONNode &node) &CSteamProto::OnLoggedOn); } -void CSteamProto::OnGotSession(const NETLIBHTTPREQUEST *response) +void CSteamProto::OnGotSession(const HttpResponse *response) { if(!response) return; @@ -258,7 +258,7 @@ void CSteamProto::HandleTokenExpired() SetStatus(ID_STATUS_OFFLINE); } -void CSteamProto::OnLoggedOn(const NETLIBHTTPREQUEST *response) +void CSteamProto::OnLoggedOn(const HttpResponse *response) { if (!CheckResponse(response)) { diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index 5ba4a4f139..1a51cccb90 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -34,7 +34,7 @@ int CSteamProto::OnSendMessage(MCONTACT hContact, const char* message) return hMessage; } -void CSteamProto::OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnMessageSent(const HttpResponse *response, void *arg) { SendMessageParam *param = (SendMessageParam*)arg; diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 5f7f081f92..e7a6844153 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -28,8 +28,8 @@ enum CMI_MAX // this item shall be the last one }; -typedef void(CSteamProto::*SteamResponseCallback)(const NETLIBHTTPREQUEST *response); -typedef void(CSteamProto::*SteamResponseWithArgCallback)(const NETLIBHTTPREQUEST *response, void *arg); +typedef void(CSteamProto::*SteamResponseCallback)(const HttpResponse *response); +typedef void(CSteamProto::*SteamResponseWithArgCallback)(const HttpResponse *response, void *arg); class CSteamProto : public PROTO { @@ -107,14 +107,14 @@ protected: bool IsOnline(); bool IsMe(const char *steamId); - void OnGotRsaKey(const NETLIBHTTPREQUEST *response); + void OnGotRsaKey(const HttpResponse *response); - void OnAuthorization(const NETLIBHTTPREQUEST *response); + void OnAuthorization(const HttpResponse *response); void OnAuthorizationError(const JSONNode &node); void OnAuthorizationSuccess(const JSONNode &node); - void OnGotSession(const NETLIBHTTPREQUEST *response); + void OnGotSession(const HttpResponse *response); - void OnLoggedOn(const NETLIBHTTPREQUEST *response); + void OnLoggedOn(const HttpResponse *response); void HandleTokenExpired(); @@ -134,28 +134,28 @@ protected: MCONTACT FindContact(const char *steamId); MCONTACT AddContact(const char *steamId, bool isTemporary = false); - void OnGotFriendList(const NETLIBHTTPREQUEST *response); - void OnGotBlockList(const NETLIBHTTPREQUEST *response); - void OnGotUserSummaries(const NETLIBHTTPREQUEST *response); - void OnGotAvatar(const NETLIBHTTPREQUEST *response, void *arg); + void OnGotFriendList(const HttpResponse *response); + void OnGotBlockList(const HttpResponse *response); + void OnGotUserSummaries(const HttpResponse *response); + void OnGotAvatar(const HttpResponse *response, void *arg); - void OnFriendAdded(const NETLIBHTTPREQUEST *response, void *arg); - void OnFriendBlocked(const NETLIBHTTPREQUEST *response, void *arg); - void OnFriendRemoved(const NETLIBHTTPREQUEST *response, void *arg); + void OnFriendAdded(const HttpResponse *response, void *arg); + void OnFriendBlocked(const HttpResponse *response, void *arg); + void OnFriendRemoved(const HttpResponse *response, void *arg); - void OnAuthRequested(const NETLIBHTTPREQUEST *response, void *arg); + void OnAuthRequested(const HttpResponse *response, void *arg); - void OnPendingApproved(const NETLIBHTTPREQUEST *response, void *arg); - void OnPendingIgnoreded(const NETLIBHTTPREQUEST *response, void *arg); + void OnPendingApproved(const HttpResponse *response, void *arg); + void OnPendingIgnoreded(const HttpResponse *response, void *arg); - void OnSearchByIdEnded(const NETLIBHTTPREQUEST *response, void *arg); + void OnSearchByIdEnded(const HttpResponse *response, void *arg); - void OnSearchByNameStarted(const NETLIBHTTPREQUEST *response, void *arg); - void OnSearchByNameFinished(const NETLIBHTTPREQUEST *response, void *arg); + void OnSearchByNameStarted(const HttpResponse *response, void *arg); + void OnSearchByNameFinished(const HttpResponse *response, void *arg); // messages int OnSendMessage(MCONTACT hContact, const char* message); - void OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg); + void OnMessageSent(const HttpResponse *response, void *arg); // menus static int hChooserMenu; diff --git a/protocols/Steam/src/steam_request.cpp b/protocols/Steam/src/steam_request.cpp index 968c09da37..0254d16db6 100644 --- a/protocols/Steam/src/steam_request.cpp +++ b/protocols/Steam/src/steam_request.cpp @@ -18,7 +18,7 @@ public: SteamResponseDelegate(CSteamProto *proto, SteamResponseWithArgCallback responseCallback, void *arg, HttpFinallyCallback httpFinallyCallback) : proto(proto), responseCallback(NULL), responseWithArgCallback(responseCallback), arg(arg), httpFinallyCallback(httpFinallyCallback), hasArg(true) { } - void Invoke(const NETLIBHTTPREQUEST *response) + void Invoke(const HttpResponse *response) { if (hasArg) { -- cgit v1.2.3