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 +++++++++++++++++- plugins/SendScreenshotPlus/src/DevKey.h | 3 --- plugins/SendScreenshotPlus/src/stdafx.h | 1 - 3 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 plugins/SendScreenshotPlus/src/DevKey.h (limited to 'plugins/SendScreenshotPlus/src') 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); diff --git a/plugins/SendScreenshotPlus/src/DevKey.h b/plugins/SendScreenshotPlus/src/DevKey.h deleted file mode 100644 index 2999f74466..0000000000 --- a/plugins/SendScreenshotPlus/src/DevKey.h +++ /dev/null @@ -1,3 +0,0 @@ -#ifndef DEVKEY_IMAGESHACK -#define DEVKEY_IMAGESHACK "IA5ZRTV6fb6256ccbc3c38650bdce6e6dcfc9e55" /*Test DevKey*/ -#endif diff --git a/plugins/SendScreenshotPlus/src/stdafx.h b/plugins/SendScreenshotPlus/src/stdafx.h index f56407477d..0d6364dff7 100644 --- a/plugins/SendScreenshotPlus/src/stdafx.h +++ b/plugins/SendScreenshotPlus/src/stdafx.h @@ -85,7 +85,6 @@ using namespace std; #include "CSendHost_ImageShack.h" #include "CSendHost_uploadpie.h" #include "CSendHost_imgur.h" -#include "DevKey.h" #include "UMainForm.h" #include "Utils.h" -- cgit v1.2.3