summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/http.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Discord/src/http.cpp')
-rw-r--r--protocols/Discord/src/http.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/protocols/Discord/src/http.cpp b/protocols/Discord/src/http.cpp
index e5941a71a4..a9136c5552 100644
--- a/protocols/Discord/src/http.cpp
+++ b/protocols/Discord/src/http.cpp
@@ -43,10 +43,14 @@ AsyncHttpRequest::AsyncHttpRequest(CDiscordProto *ppro, int iRequestType, LPCSTR
cbSize = sizeof(NETLIBHTTPREQUEST);
if (*_url == '/') { // relative url leads to a site
- m_szUrl = "https://discordapp.com/api";
+ m_szUrl = "https://discordapp.com/api/v6";
m_szUrl += _url;
+ m_bMainSite = true;
+ }
+ else {
+ m_szUrl = _url;
+ m_bMainSite = false;
}
- else m_szUrl = _url;
flags = NLHRF_HTTP11 | NLHRF_REDIRECT | NLHRF_SSL;
if (ppro->m_szAccessToken != NULL) {
@@ -98,6 +102,15 @@ AsyncHttpRequest* operator<<(AsyncHttpRequest *pReq, const INT_PARAM &param)
return pReq;
}
+AsyncHttpRequest* operator<<(AsyncHttpRequest *pReq, const INT64_PARAM &param)
+{
+ CMStringA &s = pReq->m_szParam;
+ if (!s.IsEmpty())
+ s.AppendChar('&');
+ s.AppendFormat("%s=%lld", param.szName, param.iValue);
+ return pReq;
+}
+
AsyncHttpRequest* operator<<(AsyncHttpRequest *pReq, const CHAR_PARAM &param)
{
CMStringA &s = pReq->m_szParam;