From 18c00edc2e3db21b3b4b36ee8e414ed6779bc8cb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 17 Apr 2020 14:16:15 +0300 Subject: Discord: fix for approving authorization --- protocols/Discord/src/proto.cpp | 7 +++---- 1 file 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; } -- cgit v1.2.3