summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-07-22 14:51:41 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-07-22 14:51:41 +0300
commita649fb38df9fe563e45d38a7f9d329fba2ed1dfd (patch)
treeb4ce64c79a7f6be0e59e790069bcf430b60413af
parent2e91047d7333f7795cbda482fb3dc22c1b1096b3 (diff)
Tipper: old event processing code removed
-rw-r--r--plugins/TipperYM/src/subst.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index 55661ecf0f..bdc900221e 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -165,18 +165,9 @@ bool UidName(char *szProto, wchar_t *buff, int bufflen)
wchar_t* GetLastMessageText(MCONTACT hContact, bool received)
{
for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
- DBEVENTINFO dbei = {};
- db_event_get(hDbEvent, &dbei);
+ DB::EventInfo dbei(hDbEvent);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT) == received) {
- dbei.pBlob = (char *)alloca(dbei.cbBlob);
- db_event_get(hDbEvent, &dbei);
- if (dbei.cbBlob == 0 || dbei.pBlob == nullptr)
- return nullptr;
-
- wchar_t *buff = DbEvent_GetText(&dbei);
- wchar_t *swzMsg = mir_wstrdup(buff);
- mir_free(buff);
-
+ wchar_t *swzMsg = dbei.getText();
StripBBCodesInPlace(swzMsg);
return swzMsg;
}