diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-20 13:34:45 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-20 13:34:45 +0300 |
commit | e96132b4d5344d2d58d247906bcaefccfb9d5253 (patch) | |
tree | 24a9524e4900547f2ba3a461e228fd3c98c0410d /plugins/BasicHistory/src | |
parent | 4dac8bd56f9116ac76423b2664286ed894ca80c2 (diff) |
DBEVENTINFO::hContact to be returned inside an event, no need to call db_event_getContact() just after db_event_get()
Diffstat (limited to 'plugins/BasicHistory/src')
-rw-r--r-- | plugins/BasicHistory/src/DatExport.cpp | 2 | ||||
-rw-r--r-- | plugins/BasicHistory/src/EventList.cpp | 4 | ||||
-rw-r--r-- | plugins/BasicHistory/src/Scheduler.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
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<IImport::ExternalMessage>& 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<uint32_t, IImport::ExternalMessage>(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<IImport::ExternalMessage> 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);
}
|