diff options
author | George Hazan <george.hazan@gmail.com> | 2024-01-09 13:13:23 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-01-09 13:13:23 +0300 |
commit | 110fdc1157d94f5d787a21c60163681767fdd6c4 (patch) | |
tree | 3a401fa5b6d10e397784f4a7aa1cda38beee9fb9 /protocols/Gadu-Gadu | |
parent | 74c01c7fb7862ec01ad27c4b225b08b7aa0f3b0a (diff) |
more strict constructor of MHttpRequest to avoid quirks
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r-- | protocols/Gadu-Gadu/src/avatar.cpp | 9 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/oauth.cpp | 9 |
2 files changed, 6 insertions, 12 deletions
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index c9887a1da4..0bfce1c00c 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -51,8 +51,7 @@ bool GaduProto::getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts) char szUrl[128];
mir_snprintf(szUrl, "http://api.gadu-gadu.pl/avatars/%d/0.xml", uin);
- MHttpRequest req;
- req.requestType = REQUEST_GET;
+ MHttpRequest req(REQUEST_GET);
req.m_szUrl = szUrl;
req.flags = NLHRF_NODUMP | NLHRF_HTTP11 | NLHRF_REDIRECT;
@@ -225,8 +224,7 @@ void __cdecl GaduProto::avatarrequestthread(void*) ai.hContact = data->hContact;
ai.format = getByte(ai.hContact, GG_KEY_AVATARTYPE, GG_KEYDEF_AVATARTYPE);
- MHttpRequest req;
- req.requestType = REQUEST_GET;
+ MHttpRequest req(REQUEST_GET);
req.m_szUrl = data->szAvatarURL;
req.flags = NLHRF_NODUMP | NLHRF_HTTP11 | NLHRF_REDIRECT;
@@ -372,8 +370,7 @@ void __cdecl GaduProto::setavatarthread(void *param) char* token = getStringA(GG_KEY_TOKEN);
// construct request
- MHttpRequest req = {};
- req.requestType = REQUEST_POST;
+ MHttpRequest req(REQUEST_POST);
req.m_szUrl = "http://avatars.nowe.gg/upload";
req.flags = NLHRF_NODUMP | NLHRF_HTTP11;
req.AddHeader("X-Request", "JSON");
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp index 084b4df1bf..70f145ce33 100644 --- a/protocols/Gadu-Gadu/src/oauth.cpp +++ b/protocols/Gadu-Gadu/src/oauth.cpp @@ -283,8 +283,7 @@ int GaduProto::oauth_receivetoken() NLHR_PTR resp(0);
{
- MHttpRequest req;
- req.requestType = REQUEST_POST;
+ MHttpRequest req(REQUEST_POST);
req.m_szUrl = "http://api.gadu-gadu.pl/request_token";
req.flags = NLHRF_NODUMP | NLHRF_HTTP11 | NLHRF_PERSISTENT;
req.AddHeader("User-Agent", GG8_VERSION);
@@ -313,8 +312,7 @@ int GaduProto::oauth_receivetoken() // 2. Obtaining User Authorization
debugLogA("oauth_receivetoken(): Obtaining User Authorization...");
{
- MHttpRequest req;
- req.requestType = REQUEST_POST;
+ MHttpRequest req(REQUEST_POST);
req.m_szUrl = "https://login.gadu-gadu.pl/authorize";
req.flags = NLHRF_NODUMP | NLHRF_HTTP11;
req.m_szParam.Format("callback_url=%s&request_token=%s&uin=%s&password=%s", ptrA(oauth_uri_escape("http://www.mojageneracja.pl")), token, uin, password);
@@ -335,8 +333,7 @@ int GaduProto::oauth_receivetoken() token = nullptr;
token_secret = nullptr;
{
- MHttpRequest req;
- req.requestType = REQUEST_POST;
+ MHttpRequest req(REQUEST_POST);
req.m_szUrl = "http://api.gadu-gadu.pl/access_token";
req.flags = NLHRF_NODUMP | NLHRF_HTTP11 | NLHRF_PERSISTENT;
req.nlc = nlc;
|