summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-05-13 13:16:41 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-05-13 13:16:41 +0300
commit632700c7828d2b9667c8dc8bc3403f910b51e158 (patch)
treea0eebd39c1a49e9cf51f4fb8425bdf9d3e73fbdb /plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
parentc42f503c8e3c1e6e4a7689b3b3cff17d2722c9ac (diff)
fixes #5017 (SendSS: UploadPie not working) + some code formatting
Diffstat (limited to 'plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp')
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
index 02edf18f38..d98a07e194 100644
--- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
@@ -35,18 +35,18 @@ int CSendHost_Imgur::Send()
Exit(ACKRESULT_FAILED);
return !m_bAsync;
}
-
+
m_pRequest.reset(new MHttpRequest(REQUEST_POST));
- char* tmp; tmp = mir_u2a(m_pszFile);
+ T2Utf tmp(m_pszFile);
HTTPFormData frm[] = {
{ "Authorization", HTTPFORM_HEADER("Client-ID 2a7303d78abe041") },
{ "image", HTTPFORM_FILE(tmp) },
};
int error = HTTPFormCreate(m_pRequest.get(), "https://api.imgur.com/3/image", frm, _countof(frm));
- mir_free(tmp);
if (error)
return !m_bAsync;
+
// start upload thread
if (m_bAsync) {
mir_forkthread(&CSendHost_Imgur::SendThread, this);
@@ -56,9 +56,9 @@ int CSendHost_Imgur::Send()
return 1;
}
-void CSendHost_Imgur::SendThread(void* obj)
+void CSendHost_Imgur::SendThread(void *obj)
{
- CSendHost_Imgur *self = (CSendHost_Imgur*)obj;
+ CSendHost_Imgur *self = (CSendHost_Imgur *)obj;
// send DATA and wait for m_nlreply
NLHR_PTR reply(Netlib_HttpTransaction(g_hNetlibUser, self->m_pRequest.get()));
if (reply) {