From ee8bc91349c7adfb304b6bc396fc756f74cb4707 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 25 May 2025 16:51:30 +0300 Subject: fixes #5016 completely --- .../SendScreenshotPlus/src/CSendHost_ImageShack.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp') 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); -- cgit v1.2.3