summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-02-28 11:25:23 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-02-28 11:25:23 +0300
commite70028aeff4dad25c97226f6faeeb995ab99e9b1 (patch)
tree09cc61218ded83a1bc2a0b9867e7057eb16eb6e1 /protocols/Discord/src
parent45f046e0f5c7325c7ef3638bfd5527e2878f2c84 (diff)
Discord doesn't like expired cookies
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/gateway.cpp7
-rw-r--r--protocols/Discord/src/proto.h3
2 files changed, 5 insertions, 5 deletions
diff --git a/protocols/Discord/src/gateway.cpp b/protocols/Discord/src/gateway.cpp
index 89ab8fdcbe..56d2b9ccf5 100644
--- a/protocols/Discord/src/gateway.cpp
+++ b/protocols/Discord/src/gateway.cpp
@@ -49,10 +49,9 @@ bool CDiscordProto::GatewayThreadWorker()
{ 0, 0 },
};
- CMStringA szCookie(getMStringA("WSCookie"));
- if (!szCookie.IsEmpty()) {
+ if (!m_szWSCookie.IsEmpty()) {
hdrs[1].szName = "Cookie";
- hdrs[1].szValue = szCookie.GetBuffer();
+ hdrs[1].szValue = m_szWSCookie.GetBuffer();
}
NLHR_PTR pReply(WebSocket_Connect(m_hGatewayNetlibUser, m_szGateway + "/?encoding=json&v=8", hdrs));
@@ -65,7 +64,7 @@ bool CDiscordProto::GatewayThreadWorker()
char *p = strchr(pszNewCookie, ';');
if (p) *p = 0;
- setString("WSCookie", pszNewCookie);
+ m_szWSCookie = pszNewCookie;
}
if (pReply->resultCode != 101)
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index fb7a95be86..9dc5f19e35 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -224,7 +224,8 @@ class CDiscordProto : public PROTO<CDiscordProto>
CMStringA
m_szGateway, // gateway url
m_szGatewaySessionId, // current session id
- m_szCookie; // cookie used for all http queries
+ m_szCookie, // cookie used for all http queries
+ m_szWSCookie; // cookie used for establishing websocket connection
HNETLIBUSER m_hGatewayNetlibUser; // the separate netlib user handle for gateways
HNETLIBCONN m_hGatewayConnection; // gateway connection