diff options
author | George Hazan <george.hazan@gmail.com> | 2024-01-10 12:11:16 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-01-10 12:11:16 +0300 |
commit | 730c132f369842cd219388905cf981c2e90f98b3 (patch) | |
tree | e347546e613854070cfd3da32eb0e2e8d30b3b91 /protocols/Twitter/src/utility.cpp | |
parent | e688d75e8db7616d7e6d6fb3ed3c892e4fbe8a97 (diff) |
code cleaning
Diffstat (limited to 'protocols/Twitter/src/utility.cpp')
-rw-r--r-- | protocols/Twitter/src/utility.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/protocols/Twitter/src/utility.cpp b/protocols/Twitter/src/utility.cpp index c46c146390..09e764f5f6 100644 --- a/protocols/Twitter/src/utility.cpp +++ b/protocols/Twitter/src/utility.cpp @@ -66,32 +66,3 @@ void CTwitterProto::ShowPopup(const char *text, int Error) }
PUAddPopupW(&popup);
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-bool save_url(HNETLIBUSER hNetlib, const CMStringA &url, const CMStringW &filename)
-{
- MHttpRequest req(REQUEST_GET);
- req.flags = NLHRF_HTTP11 | NLHRF_REDIRECT;
- req.m_szUrl = const_cast<char*>(url.c_str());
-
- NLHR_PTR resp(Netlib_HttpTransaction(hNetlib, &req));
- if (!resp)
- return false;
-
- if (resp->resultCode != 200)
- return false;
-
- // Create folder if necessary
- if (CreatePathToFileW(filename) != ERROR_SUCCESS)
- return false;
-
- // Write to file
- if (FILE *f = _wfopen(filename, L"wb")) {
- fwrite(resp->body, 1, resp->body.GetLength(), f);
- fclose(f);
- }
- else return false;
-
- return true;
-}
|