diff options
Diffstat (limited to 'protocols/Discord/src/proto.cpp')
-rw-r--r-- | protocols/Discord/src/proto.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index 129e9eee64..55df6c34c5 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -17,9 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" -static int compareMessages(const SnowFlake *p1, const SnowFlake *p2) +static int compareMessages(const COwnMessage *p1, const COwnMessage *p2) { - return compareInt64(*p1, *p2); + return compareInt64(p1->nonce, p2->nonce); } static int compareRequests(const AsyncHttpRequest *p1, const AsyncHttpRequest *p2) @@ -392,11 +392,10 @@ int CDiscordProto::SendMsg(MCONTACT hContact, int /*flags*/, const char *pszSrc) // 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", nonce); - arOwnMessages.insert(new SnowFlake(nonce)); CMStringA szUrl(FORMAT, "/channels/%lld/messages", pUser->channelId); AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, szUrl, &CDiscordProto::OnReceiveMessage, &body); - pReq->pUserInfo = (void*)hContact; + arOwnMessages.insert(new COwnMessage(nonce, pReq->m_iReqNum)); Push(pReq); return pReq->m_iReqNum; } |