summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Discord/src/guilds.cpp4
-rw-r--r--protocols/Discord/src/http.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index 58a8b29651..8ce9ceac61 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -329,8 +329,10 @@ void CDiscordProto::LoadGuildInfo(CDiscordGuild *pGuild)
if (fileId != -1) {
size_t length = _filelength(fileId);
ptrA buf((char *)mir_alloc(length+1));
- _read(fileId, buf, (unsigned)length);
+ int result = _read(fileId, buf, (unsigned)length);
_close(fileId);
+ if (result == -1)
+ return;
JSONNode root(JSONNode::parse(buf));
for (auto &cc : root) {
diff --git a/protocols/Discord/src/http.cpp b/protocols/Discord/src/http.cpp
index ca4d7d0650..efc9f70339 100644
--- a/protocols/Discord/src/http.cpp
+++ b/protocols/Discord/src/http.cpp
@@ -41,7 +41,7 @@ static LONG g_reqNum = 0;
AsyncHttpRequest::AsyncHttpRequest(CDiscordProto *ppro, int iRequestType, LPCSTR _url, MTHttpRequestHandler pFunc, JSONNode *pRoot)
{
if (*_url == '/') { // relative url leads to a site
- m_szUrl = "https://discord.com/api/v6";
+ m_szUrl = "https://discord.com/api/v8";
m_szUrl += _url;
m_bMainSite = true;
}