From a1cc2175f61db72a71b26c5be3787f977c021cfb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 2 Apr 2014 11:04:09 +0000 Subject: DBEVENTINFO::isMarkRead() - new helper to simplify bit logic git-svn-id: http://svn.miranda-ng.org/main/trunk@8825 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/globals.cpp | 2 +- plugins/TabSRMM/src/mim.cpp | 2 +- plugins/TabSRMM/src/msglog.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 3d5e7bd8f0..760718eb43 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -578,7 +578,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) while (hDbEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); - if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && dbei.eventType == EVENTTYPE_MESSAGE) { + if (!dbei.markedRead() && dbei.eventType == EVENTTYPE_MESSAGE) { if (M.FindWindow(hContact) != NULL) continue; diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 53dcd6aa31..0425068261 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -527,7 +527,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM lParam) BOOL isCustomEvent = IsCustomEvent(dbei.eventType); BOOL isShownCustomEvent = DbEventIsForMsgWindow(&dbei); - if ((dbei.flags & (DBEF_READ | DBEF_SENT)) || (isCustomEvent && !isShownCustomEvent)) + if (dbei.markedRead() || (isCustomEvent && !isShownCustomEvent)) return 0; CallServiceSync(MS_CLIST_REMOVEEVENT, hContact, 1); diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 00ba701c84..e416f923e8 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -595,7 +595,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, } } - if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & (DBEF_SENT | DBEF_READ))) + if (dbei.eventType == EVENTTYPE_MESSAGE && !dbei.markedRead()) dat->cache->updateStats(TSessionStats::SET_LAST_RCV, lstrlenA((char *) dbei.pBlob)); if (rtfMessage == NULL) { @@ -625,7 +625,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, dwEffectiveFlags = dat->dwFlags; - dat->isHistory = (dbei.timestamp < dat->cache->getSessionStart() && (dbei.flags & DBEF_READ || dbei.flags & DBEF_SENT)); + dat->isHistory = (dbei.timestamp < dat->cache->getSessionStart() && dbei.markedRead()); iFontIDOffset = dat->isHistory ? 8 : 0; // offset into the font table for either history (old) or new events... (# of fonts per configuration set) isSent = (dbei.flags & DBEF_SENT); -- cgit v1.2.3