summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-04-17 14:16:15 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-04-17 14:16:15 +0300
commit18c00edc2e3db21b3b4b36ee8e414ed6779bc8cb (patch)
treeb4e1c25c779b99f006d90460d5ddec1ea087c315
parent8ef3e712e44c9f4704375b55fc6487e131d93f8a (diff)
Discord: fix for approving authorization
-rw-r--r--protocols/Discord/src/proto.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index bb88415a52..097dd3e2fe 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -338,9 +338,7 @@ int CDiscordProto::AuthRequest(MCONTACT hContact, const wchar_t*)
return 1; // error
JSONNode root; root << WCHAR_PARAM("username", wszUsername) << INT_PARAM("discriminator", iDiscriminator);
- AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, "/users/@me/relationships", nullptr, &root);
- pReq->pUserInfo = (void*)hContact;
- Push(pReq);
+ Push(new AsyncHttpRequest(this, REQUEST_POST, "/users/@me/relationships", nullptr, &root));
return 0;
}
@@ -358,9 +356,10 @@ int CDiscordProto::Authorize(MEVENT hDbEvent)
if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return 1;
if (mir_strcmp(dbei.szModule, m_szModuleName)) return 1;
+ JSONNode root;
MCONTACT hContact = DbGetAuthEventContact(&dbei);
CMStringA szUrl(FORMAT, "/users/@me/relationships/%lld", getId(hContact, DB_KEY_ID));
- Push(new AsyncHttpRequest(this, REQUEST_PUT, szUrl, nullptr));
+ Push(new AsyncHttpRequest(this, REQUEST_PUT, szUrl, nullptr, &root));
return 0;
}