From ab75f8e4a3968c956425844415237a4fa6fcee63 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Tue, 26 May 2015 19:15:20 +0000 Subject: Steam: merge new api git-svn-id: http://svn.miranda-ng.org/main/trunk@13850 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_account.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'protocols/Steam/src/steam_account.cpp') diff --git a/protocols/Steam/src/steam_account.cpp b/protocols/Steam/src/steam_account.cpp index 942095d150..bbf144fc61 100644 --- a/protocols/Steam/src/steam_account.cpp +++ b/protocols/Steam/src/steam_account.cpp @@ -14,7 +14,7 @@ bool CSteamProto::IsMe(const char *steamId) return false; } -void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response, void *) +void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response) { if (response == NULL) return; @@ -69,13 +69,14 @@ void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response, void *) ptrA username(mir_utf8encodeW(getWStringA("Username"))); PushRequest( - new SteamWebApi::AuthorizationRequest(username, base64RsaEncryptedPassword, timestamp), + new AuthorizationRequest(username, base64RsaEncryptedPassword, timestamp), &CSteamProto::OnAuthorization); } -void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *) +void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response) { - if (response == NULL) { + if (response == NULL) + { SetStatus(ID_STATUS_OFFLINE); return; } @@ -109,16 +110,14 @@ void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *) CSteamGuardDialog guardDialog(this, emailDomain); if (!guardDialog.DoModal()) - { return; - } ptrA username(mir_utf8encodeW(getWStringA("Username"))); ptrA password(getStringA("EncryptedPassword")); ptrA timestamp(getStringA("RsaTimestamp")); PushRequest( - new SteamWebApi::AuthorizationRequest(username, password, timestamp, guardDialog.GetGuardCode()), + new AuthorizationRequest(username, password, timestamp, guardDialog.GetGuardCode()), &CSteamProto::OnAuthorization); return; } @@ -129,7 +128,7 @@ void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *) node = json_get(root, "captcha_gid"); ptrA captchaId(mir_u2a(ptrT(json_as_string(node)))); - SteamWebApi::GetCaptchaRequest *request = new SteamWebApi::GetCaptchaRequest(captchaId); + GetCaptchaRequest *request = new GetCaptchaRequest(captchaId); NETLIBHTTPREQUEST *response = request->Send(m_hNetlibUser); delete request; @@ -146,7 +145,7 @@ void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *) ptrA timestamp(getStringA("RsaTimestamp")); PushRequest( - new SteamWebApi::AuthorizationRequest(username, password, timestamp, captchaId, captchaDialog.GetCaptchaText()), + new AuthorizationRequest(username, password, timestamp, captchaId, captchaDialog.GetCaptchaText()), &CSteamProto::OnAuthorization); return; } @@ -185,15 +184,15 @@ void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *) delSetting("EncryptedPassword"); PushRequest( - new SteamWebApi::GetSessionRequest(token, steamId, cookie), + new GetSessionRequest(token, steamId, cookie), &CSteamProto::OnGotSession); PushRequest( - new SteamWebApi::LogonRequest(token), + new LogonRequest(token), &CSteamProto::OnLoggedOn); } -void CSteamProto::OnGotSession(const NETLIBHTTPREQUEST *response, void *) +void CSteamProto::OnGotSession(const NETLIBHTTPREQUEST *response) { if(response == NULL) return; @@ -224,7 +223,7 @@ void CSteamProto::HandleTokenExpired() SetStatus(ID_STATUS_OFFLINE); } -void CSteamProto::OnLoggedOn(const NETLIBHTTPREQUEST *response, void *) +void CSteamProto::OnLoggedOn(const NETLIBHTTPREQUEST *response) { if (response == NULL) { @@ -255,7 +254,7 @@ void CSteamProto::OnLoggedOn(const NETLIBHTTPREQUEST *response, void *) ptrA steamId(getStringA("SteamID")); PushRequest( - new SteamWebApi::GetFriendListRequest(token, steamId), + new GetFriendListRequest(token, steamId), &CSteamProto::OnGotFriendList); // start polling thread -- cgit v1.2.3