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/Spamotron | |
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/Spamotron')
-rw-r--r-- | plugins/Spamotron/src/spamotron.cpp | 2 | ||||
-rw-r--r-- | plugins/Spamotron/src/utils.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
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); |