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/StopSpamMod | |
parent | ffc5a3d7550528281976745279e77ac9faba551b (diff) |
major code cleaning in regard to db_event_getBlobSize & event memory allocation
Diffstat (limited to 'plugins/StopSpamMod')
-rwxr-xr-x | plugins/StopSpamMod/src/stopspam.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index b32afb3e90..f1e7ca9361 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -19,14 +19,11 @@ int OnDbEventAdded(WPARAM hContact, LPARAM hDbEvent) { - DBEVENTINFO dbei = {}; - dbei.cbBlob = db_event_getBlobSize(hDbEvent); - if (dbei.cbBlob == -1) + DB::EventInfo dbei; + dbei.cbBlob = -1; + if (db_event_get(hDbEvent, &dbei)) return 0; - dbei.pBlob = (BYTE*)alloca(dbei.cbBlob); - db_event_get(hDbEvent, &dbei); - // if event is in protocol that is not despammed if (!ProtoInList(dbei.szModule)) return 0; |