diff options
Diffstat (limited to 'protocols/Gadu-Gadu/src/oauth.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/oauth.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp index 361b3ff81c..db2a8220f9 100644 --- a/protocols/Gadu-Gadu/src/oauth.cpp +++ b/protocols/Gadu-Gadu/src/oauth.cpp @@ -319,7 +319,7 @@ int GGPROTO::oauth_receivetoken() }
// 1. Obtaining an Unauthorized Request Token
- netlog("oauth_receivetoken(): Obtaining an Unauthorized Request Token...");
+ debugLogA("oauth_receivetoken(): Obtaining an Unauthorized Request Token...");
strcpy(szUrl, "http://api.gadu-gadu.pl/request_token");
str = oauth_auth_header("POST", szUrl, HMACSHA1, uin, password, NULL, NULL);
@@ -338,7 +338,7 @@ int GGPROTO::oauth_receivetoken() req.headersCount = 3;
req.headers = httpHeaders;
- NETLIBHTTPREQUEST *resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)netlib, (LPARAM)&req);
+ NETLIBHTTPREQUEST *resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req);
if (resp) {
nlc = resp->nlc;
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
@@ -355,13 +355,13 @@ int GGPROTO::oauth_receivetoken() }
mir_free(xmlAction);
}
- else netlog("oauth_receivetoken(): Invalid response code from HTTP request");
+ else debugLogA("oauth_receivetoken(): Invalid response code from HTTP request");
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
}
- else netlog("oauth_receivetoken(): No response from HTTP request");
+ else debugLogA("oauth_receivetoken(): No response from HTTP request");
// 2. Obtaining User Authorization
- netlog("oauth_receivetoken(): Obtaining User Authorization...");
+ debugLogA("oauth_receivetoken(): Obtaining User Authorization...");
mir_free(str);
str = oauth_uri_escape("http://www.mojageneracja.pl");
@@ -383,12 +383,12 @@ int GGPROTO::oauth_receivetoken() req.pData = str;
req.dataLength = (int)strlen(str);
- resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)netlib, (LPARAM)&req);
+ resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req);
if (resp) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
- else netlog("oauth_receivetoken(): No response from HTTP request");
+ else debugLogA("oauth_receivetoken(): No response from HTTP request");
// 3. Obtaining an Access Token
- netlog("oauth_receivetoken(): Obtaining an Access Token...");
+ debugLogA("oauth_receivetoken(): Obtaining an Access Token...");
strcpy(szUrl, "http://api.gadu-gadu.pl/access_token");
mir_free(str);
str = oauth_auth_header("POST", szUrl, HMACSHA1, uin, password, token, token_secret);
@@ -408,7 +408,7 @@ int GGPROTO::oauth_receivetoken() httpHeaders[1].szName = "Authorization";
httpHeaders[1].szValue = str;
- resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)netlib, (LPARAM)&req);
+ resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req);
if (resp) {
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
TCHAR *xmlAction = mir_a2t(resp->pData);
@@ -424,11 +424,11 @@ int GGPROTO::oauth_receivetoken() }
mir_free(xmlAction);
}
- else netlog("oauth_receivetoken(): Invalid response code from HTTP request");
+ else debugLogA("oauth_receivetoken(): Invalid response code from HTTP request");
Netlib_CloseHandle(resp->nlc);
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
}
- else netlog("oauth_receivetoken(): No response from HTTP request");
+ else debugLogA("oauth_receivetoken(): No response from HTTP request");
mir_free(password);
mir_free(str);
@@ -437,13 +437,13 @@ int GGPROTO::oauth_receivetoken() setString(GG_KEY_TOKEN, token);
CallService(MS_DB_CRYPT_ENCODESTRING, (WPARAM)(int)strlen(token_secret) + 1, (LPARAM) token_secret);
setString(GG_KEY_TOKENSECRET, token_secret);
- netlog("oauth_receivetoken(): Access Token obtained successfully.");
+ debugLogA("oauth_receivetoken(): Access Token obtained successfully.");
res = 1;
}
else {
delSetting(GG_KEY_TOKEN);
delSetting(GG_KEY_TOKENSECRET);
- netlog("oauth_receivetoken(): Failed to obtain Access Token.");
+ debugLogA("oauth_receivetoken(): Failed to obtain Access Token.");
}
mir_free(token);
mir_free(token_secret);
|