From e96132b4d5344d2d58d247906bcaefccfb9d5253 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Dec 2023 13:34:45 +0300 Subject: DBEVENTINFO::hContact to be returned inside an event, no need to call db_event_getContact() just after db_event_get() --- protocols/Discord/src/server.cpp | 2 +- protocols/Discord/src/voice.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/Discord/src') diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp index 94f41aa5ed..096da0968d 100644 --- a/protocols/Discord/src/server.cpp +++ b/protocols/Discord/src/server.cpp @@ -116,7 +116,7 @@ void CDiscordProto::OnReceiveHistory(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest ProcessChatUser(pUser, _atoi64(szUserId), pNode); } - dbei.pBlob = buf.data(); + dbei.pBlob = (char *)buf.data(); dbei.cbBlob = (uint32_t)buf.length(); bool bSucceeded = false; diff --git a/protocols/Discord/src/voice.cpp b/protocols/Discord/src/voice.cpp index 5d1ccf1ea7..48e5290c23 100644 --- a/protocols/Discord/src/voice.cpp +++ b/protocols/Discord/src/voice.cpp @@ -42,7 +42,7 @@ void CDiscordProto::OnCommandCallCreated(const JSONNode &pRoot) dbei.timestamp = pCall->startTime; dbei.eventType = EVENT_INCOMING_CALL; dbei.cbBlob = uint32_t(mir_strlen(szMessage) + 1); - dbei.pBlob = (uint8_t *)szMessage; + dbei.pBlob = szMessage; dbei.flags = DBEF_UTF; db_event_add(pUser->hContact, &dbei); } @@ -76,7 +76,7 @@ void CDiscordProto::OnCommandCallDeleted(const JSONNode &pRoot) dbei.timestamp = currTime; dbei.eventType = EVENT_CALL_FINISHED; dbei.cbBlob = uint32_t(szMessage.GetLength() + 1); - dbei.pBlob = (uint8_t *)szMessage.c_str(); + dbei.pBlob = szMessage.GetBuffer(); dbei.flags = DBEF_UTF; db_event_add(pUser->hContact, &dbei); } -- cgit v1.2.3