From 3d30ed65f9e226b7b183b23ce5dba435ec491f0b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 10 Jan 2025 18:28:28 +0300 Subject: DBEVENTINFO::timestamp to become 64-bit integer --- plugins/TipperYM/src/subst.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/TipperYM/src/subst.cpp') diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index bdc900221e..7bdbcbe36f 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -124,8 +124,8 @@ uint32_t LastMessageTimestamp(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); - if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT) == received) - return dbei.timestamp; + if (dbei.eventType == EVENTTYPE_MESSAGE && dbei.bSent != received) + return dbei.getUnixtime(); } return 0; @@ -166,7 +166,7 @@ wchar_t* GetLastMessageText(MCONTACT hContact, bool received) { for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { DB::EventInfo dbei(hDbEvent); - if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT) == received) { + if (dbei.eventType == EVENTTYPE_MESSAGE && dbei.bSent != received) { wchar_t *swzMsg = dbei.getText(); StripBBCodesInPlace(swzMsg); return swzMsg; @@ -367,9 +367,9 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int DBEVENTINFO dbei = {}; if (!db_event_get(dbe, &dbei)) { if (dbei.eventType == EVENTTYPE_MESSAGE) { - dwNewTs = max(dwNewTs, dbei.timestamp); - if (dbei.timestamp > dwLastTs) { - if (dbei.flags & DBEF_SENT) dwCountOut++; + dwNewTs = max(dwNewTs, dbei.getUnixtime()); + if (dbei.getUnixtime() > dwLastTs) { + if (dbei.bSent) dwCountOut++; else dwCountIn++; } else break; -- cgit v1.2.3