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/Spamotron/src/spamotron.cpp | 2 +- plugins/Spamotron/src/utils.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/Spamotron/src') diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index 76ea50fbd8..40340c72a7 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -234,7 +234,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) szAuthEventModule = mir_u2a(AuthEventModule); dbei2.szModule = szAuthEventModule; dbei2.timestamp = dbei->timestamp; - dbei2.pBlob = _dbv.pbVal + sizeof(uint32_t); + dbei2.pBlob = (char*)_dbv.pbVal + sizeof(uint32_t); db_event_add(hContact, &dbei2); g_plugin.delSetting(hContact, "AuthEvent"); diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index c829b5f101..3c17ff7dbb 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -465,7 +465,7 @@ int LogToSystemHistory(char *message, char *origmessage) DBEVENTINFO dbei = {}; dbei.timestamp = time(&tm); dbei.szModule = MODULENAME; - dbei.pBlob = (uint8_t*)msg; + dbei.pBlob = msg; if (origmessage) dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s %s: %s", MODULENAME, message, DOT(message), Translate("Their message was"), origmessage)); else @@ -498,7 +498,7 @@ void MarkUnread(MCONTACT hContact) pos += mir_strlen((const char*)pos)+1; memcpy(&dbei.cbBlob, pos, sizeof(uint32_t)); pos += sizeof(uint32_t); - dbei.pBlob = (uint8_t*)malloc(dbei.cbBlob); + dbei.pBlob = (char *)malloc(dbei.cbBlob); memcpy(dbei.pBlob, pos, dbei.cbBlob); pos += dbei.cbBlob; db_event_add(hContact,&dbei); -- cgit v1.2.3