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() --- plugins/BasicHistory/src/DatExport.cpp | 2 +- plugins/BasicHistory/src/EventList.cpp | 4 ++-- plugins/BasicHistory/src/Scheduler.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/BasicHistory/src') diff --git a/plugins/BasicHistory/src/DatExport.cpp b/plugins/BasicHistory/src/DatExport.cpp index fd3718c334..9d11a75860 100644 --- a/plugins/BasicHistory/src/DatExport.cpp +++ b/plugins/BasicHistory/src/DatExport.cpp @@ -181,7 +181,7 @@ bool DatExport::GetEventList(std::vector& eventList) info.flags = messageHeader.flags; info.timestamp = messageHeader.timestamp; info.cbBlob = messageHeader.cbBlob; - info.pBlob = (uint8_t*)memBuf.c_str(); + info.pBlob = (char *)memBuf.c_str(); HistoryEventList::GetObjectDescription(&info, _str, MAXSELECTSTR); exMsg.message = _str; sortedEvents.insert(std::pair(messageHeader.timestamp, exMsg)); diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 9fbdecec16..031552102e 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -508,7 +508,7 @@ void HistoryEventList::MargeMessages(const std::vector dbei.cbBlob = WideCharToMultiByte(cp, 0, msg.message.c_str(), (int)msg.message.length() + 1, nullptr, 0, nullptr, nullptr); char* buf = new char[dbei.cbBlob]; dbei.cbBlob = WideCharToMultiByte(cp, 0, msg.message.c_str(), (int)msg.message.length() + 1, buf, dbei.cbBlob, nullptr, nullptr); - dbei.pBlob = (uint8_t*)buf; + dbei.pBlob = buf; db_event_add(m_hContact, &dbei); delete[] buf; } @@ -524,7 +524,7 @@ bool HistoryEventList::GetEventData(const EventIndex& ev, EventData& data) if (!ev.isExternal) { uint32_t newBlobSize = db_event_getBlobSize(ev.hEvent); if (newBlobSize > m_oldBlobSize) { - m_dbei.pBlob = (uint8_t*)mir_realloc(m_dbei.pBlob, newBlobSize); + m_dbei.pBlob = (char *)mir_realloc(m_dbei.pBlob, newBlobSize); m_oldBlobSize = newBlobSize; } diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 6721f102f4..98202c2382 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -1285,7 +1285,7 @@ void DoError(const TaskOptions& to, const std::wstring _error) dbei.cbBlob = WideCharToMultiByte(CP_UTF8, 0, error.c_str(), len, nullptr, 0, nullptr, nullptr); char* buf = new char[dbei.cbBlob]; dbei.cbBlob = WideCharToMultiByte(CP_UTF8, 0, error.c_str(), len, buf, dbei.cbBlob, nullptr, nullptr); - dbei.pBlob = (uint8_t*)buf; + dbei.pBlob = buf; db_event_add(NULL, &dbei); } -- cgit v1.2.3