summaryrefslogtreecommitdiff
path: root/src/mir_app/src/chat_svc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_app/src/chat_svc.cpp')
-rw-r--r--src/mir_app/src/chat_svc.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp
index dd6a377106..e1257c5ea2 100644
--- a/src/mir_app/src/chat_svc.cpp
+++ b/src/mir_app/src/chat_svc.cpp
@@ -822,9 +822,8 @@ static int OnEventAdded(WPARAM hContact, LPARAM hDbEvent)
if (Contact::IsGroupChat(hContact)) {
if (auto *si = SM_FindSessionByContact(hContact)) {
- DB::EventInfo dbei;
- dbei.cbBlob = -1;
- if (!db_event_get(hDbEvent, &dbei)) {
+ DB::EventInfo dbei(hDbEvent);
+ if (dbei) {
auto *szProto = Proto_GetBaseAccountName(si->hContact);
if (si && !mir_strcmp(szProto, dbei.szModule) && dbei.eventType == EVENTTYPE_MESSAGE && dbei.szUserId) {
CMStringA szText((char *)dbei.pBlob);