summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-05-25 16:51:30 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-05-25 16:51:34 +0300
commitee8bc91349c7adfb304b6bc396fc756f74cb4707 (patch)
tree2ac7c157eaf0ca181e71f741a9d6c0cf0c28a2f8 /plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
parent78b370670a1bc42540b8bd907d2619e829d98b3f (diff)
fixes #5016 completely
Diffstat (limited to 'plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp')
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
index a54ffdcb7e..c6a895473d 100644
--- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
@@ -46,11 +46,26 @@ CSendHost_ImageShack::~CSendHost_ImageShack()
int CSendHost_ImageShack::Send()
{
if (!g_hNetlibUser) { // check Netlib
+LBL_Error:
Error(SS_ERR_INIT, m_pszSendTyp);
Exit(ACKRESULT_FAILED);
return !m_bAsync;
}
+ CMStringA szKey(g_plugin.getMStringA("Key"));
+ if (szKey.IsEmpty()) {
+ ENTER_STRING es = {};
+ es.szModuleName = MODULENAME;
+ es.caption = TranslateT("Enter user key for Imageshack");
+ if (!EnterString(&es)) {
+ m_pszSendTyp = LPGENW("User key is missing");
+ goto LBL_Error;
+ }
+
+ szKey = es.ptszResult;
+ g_plugin.setString("Key", szKey);
+ }
+
m_pRequest.reset(new MHttpRequest(REQUEST_POST));
T2Utf tmp(m_pszFile);
HTTPFormData frm[] = {
@@ -58,12 +73,13 @@ int CSendHost_ImageShack::Send()
{ "fileupload", HTTPFORM_FILE(tmp) },
// { "rembar", "yes" },// no info bar on thumb
{ "public", "no" },
- { "key", HTTPFORM_8BIT(DEVKEY_IMAGESHACK) },
+ { "key", szKey.c_str() },
};
int error = HTTPFormCreate(m_pRequest.get(), "http://imageshack.us/upload_api.php", frm, sizeof(frm) / sizeof(HTTPFormData));
if (error)
return !m_bAsync;
+
// start upload thread
if (m_bAsync) {
mir_forkthread(&CSendHost_ImageShack::SendThreadWrapper, this);