summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp')
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
index bde9f158bb..c4bb3897f7 100644
--- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
@@ -15,8 +15,8 @@
*/
#include "stdafx.h"
-CSendHost_Imgur::CSendHost_Imgur(HWND Owner, MCONTACT hContact, bool bAsync)
- : CSend(Owner, hContact, bAsync)
+CSendHost_Imgur::CSendHost_Imgur(HWND Owner, MCONTACT hContact, bool bAsync) :
+ CSend(Owner, hContact, bAsync)
{
m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND;
m_pszSendTyp = LPGENW("Image upload");
@@ -60,10 +60,9 @@ void CSendHost_Imgur::SendThread(void* obj)
CSendHost_Imgur *self = (CSendHost_Imgur*)obj;
// send DATA and wait for m_nlreply
NLHR_PTR reply(Netlib_HttpTransaction(g_hNetlibUser, &self->m_nlhr));
- self->HTTPFormDestroy(&self->m_nlhr);
if (reply) {
- if (reply->dataLength) {
- JSONROOT root(reply->pData);
+ if (reply->body.GetLength()) {
+ JSONROOT root(reply->body);
if (root) {
if ((*root)["success"].as_bool()) {
self->m_URL = (*root)["data"]["link"].as_mstring();
@@ -80,7 +79,7 @@ void CSendHost_Imgur::SendThread(void* obj)
}
else self->Error(SS_ERR_RESPONSE, self->m_pszSendTyp, reply->resultCode);
}
- else self->Error(SS_ERR_NORESPONSE, self->m_pszSendTyp, self->m_nlhr.resultCode);
+ else self->Error(SS_ERR_NORESPONSE, self->m_pszSendTyp, 500);
self->Exit(ACKRESULT_FAILED);
}