diff options
author | George Hazan <ghazan@miranda.im> | 2021-06-05 17:50:34 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-06-05 17:50:34 +0300 |
commit | d7c9eb34f80f207efd47d2fc65e31aedf166c323 (patch) | |
tree | 338b9b905674dc31b1efab739dfcedeed3d8d7b3 /plugins/StopSpamPlus/src/events.cpp | |
parent | ffc5a3d7550528281976745279e77ac9faba551b (diff) |
major code cleaning in regard to db_event_getBlobSize & event memory allocation
Diffstat (limited to 'plugins/StopSpamPlus/src/events.cpp')
-rw-r--r-- | plugins/StopSpamPlus/src/events.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index ae3c4794a6..e6f948f2ef 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -4,15 +4,11 @@ int OnDbEventAdded(WPARAM, LPARAM lParam) {
MEVENT hDbEvent = (MEVENT)lParam;
- DBEVENTINFO dbei = {};
- dbei.cbBlob = db_event_getBlobSize(hDbEvent);
- if (-1 == dbei.cbBlob)
+ DB::EventInfo dbei;
+ dbei.cbBlob = -1;
+ if (db_event_get(hDbEvent, &dbei))
return 0;
- mir_ptr<BYTE> blob((LPBYTE)mir_alloc(dbei.cbBlob));
- dbei.pBlob = blob;
- db_event_get(hDbEvent, &dbei);
-
// if event is in protocol that is not despammed
if (g_sets.ProtoDisabled(dbei.szModule))
return 0;
|