diff options
author | George Hazan <ghazan@miranda.im> | 2019-12-28 20:56:19 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-12-28 20:56:19 +0300 |
commit | 8ae951ec9a7690cfe11e35e4d3026635a5ecb9ca (patch) | |
tree | b350dd5a55c9ce7d4b7f65169ed690cad3243e97 /protocols/Discord/src/proto.cpp | |
parent | 8bc24cb41ad6db6fc56731c9dffcb765cbd9a79f (diff) |
Discord: nonce field should be always positive, otherwise it might not work
Diffstat (limited to 'protocols/Discord/src/proto.cpp')
-rw-r--r-- | protocols/Discord/src/proto.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index dc13c2fccc..dca46990ac 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -406,8 +406,8 @@ int CDiscordProto::SendMsg(MCONTACT hContact, int /*flags*/, const char *pszSrc) // we generate a random 64-bit integer and pass it to the server // to distinguish our own messages from these generated by another clients - SnowFlake nonce; Utils_GetRandom(&nonce, sizeof(nonce)); - JSONNode body; body << WCHAR_PARAM("content", wszText) << INT64_PARAM("nonce", abs(nonce)); + SnowFlake nonce; Utils_GetRandom(&nonce, sizeof(nonce)); nonce = abs(nonce); + JSONNode body; body << WCHAR_PARAM("content", wszText) << INT64_PARAM("nonce", nonce); CMStringA szUrl(FORMAT, "/channels/%lld/messages", pUser->channelId); AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, szUrl, nullptr, &body); |