From 730c132f369842cd219388905cf981c2e90f98b3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Jan 2024 12:11:16 +0300 Subject: code cleaning --- protocols/Twitter/src/utility.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'protocols/Twitter/src/utility.cpp') 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(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; -} -- cgit v1.2.3