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/YARelay/src | |
parent | ffc5a3d7550528281976745279e77ac9faba551b (diff) |
major code cleaning in regard to db_event_getBlobSize & event memory allocation
Diffstat (limited to 'plugins/YARelay/src')
-rw-r--r-- | plugins/YARelay/src/main.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index 4a29fedc9f..5abc1cbc44 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -113,12 +113,8 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent) return 0;
// receive message from DB
- DBEVENTINFO dbei = {};
- dbei.cbBlob = db_event_getBlobSize(hDBEvent);
- if (dbei.cbBlob == -1)
- return 0;
-
- dbei.pBlob = (unsigned char*)alloca(dbei.cbBlob);
+ DB::EventInfo dbei;
+ dbei.cbBlob = -1;
db_event_get(hDBEvent, &dbei);
if (dbei.flags & DBEF_SENT || dbei.flags & DBEF_READ || (dbei.eventType != EVENTTYPE_MESSAGE))
return 0;
|