summaryrefslogtreecommitdiff
path: root/protocols/Discord
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-20 13:34:45 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-20 13:34:45 +0300
commite96132b4d5344d2d58d247906bcaefccfb9d5253 (patch)
tree24a9524e4900547f2ba3a461e228fd3c98c0410d /protocols/Discord
parent4dac8bd56f9116ac76423b2664286ed894ca80c2 (diff)
DBEVENTINFO::hContact to be returned inside an event, no need to call db_event_getContact() just after db_event_get()
Diffstat (limited to 'protocols/Discord')
-rw-r--r--protocols/Discord/src/server.cpp2
-rw-r--r--protocols/Discord/src/voice.cpp4
2 files changed, 3 insertions, 3 deletions
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);
}