diff options
author | George Hazan <ghazan@miranda.im> | 2023-04-10 18:50:46 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-04-10 18:50:46 +0300 |
commit | 90ac4c689e1322b48f6ca53a0c8fff81daf73c9c (patch) | |
tree | 63e000a99864d819650634fe8a7fa8b2be0cd1d2 /protocols/JabberG/src/jabber_rc.cpp | |
parent | 79ac0acda98f8f7a34bde30b7720a11c04281cb4 (diff) |
code cleaning
Diffstat (limited to 'protocols/JabberG/src/jabber_rc.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_rc.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 27d389cee3..983683ec43 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -449,11 +449,8 @@ int CJabberProto::RcGetUnreadEventsCount() if (jid == nullptr) continue;
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
- DB::EventInfo dbei;
- dbei.cbBlob = -1;
-
- int nGetTextResult = db_event_get(hDbEvent, &dbei);
- if (!nGetTextResult && dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) {
+ DB::EventInfo dbei(hDbEvent);
+ if (dbei && dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) {
ptrW szEventText(DbEvent_GetTextW(&dbei, CP_ACP));
if (szEventText)
nEventsSent++;
@@ -525,9 +522,8 @@ int CJabberProto::AdhocForwardHandler(const TiXmlElement*, CJabberIqInfo *pInfo, continue;
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
- DB::EventInfo dbei;
- dbei.cbBlob = -1;
- if (db_event_get(hDbEvent, &dbei))
+ DB::EventInfo dbei(hDbEvent);
+ if (!dbei)
continue;
if (dbei.eventType != EVENTTYPE_MESSAGE || (dbei.flags & (DBEF_READ | DBEF_SENT)))
|