From 1e31191afc0fbaeb211bc1f2c250ee155d21d0c0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 31 Mar 2014 14:38:25 +0000 Subject: inline method markedRead() introduced instead of bits magic git-svn-id: http://svn.miranda-ng.org/main/trunk@8807 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbcontacts.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbcontacts.cpp') diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index 7f93d731a1..ef95d40e00 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -272,7 +272,7 @@ BOOL CDb3Mmap::MetaMergeHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) DBEvent *pFirst = arEvents[0]; dbMeta->ofsFirstEvent = DWORD(PBYTE(pFirst) - m_pDbCache); pFirst->ofsPrev = 0; - dbMeta->ofsFirstUnread = (pFirst->flags & NOT_UNREAD) ? 0 : dbMeta->ofsFirstEvent; + dbMeta->ofsFirstUnread = pFirst->markedRead() ? 0 : dbMeta->ofsFirstEvent; DBEvent *pLast = arEvents[arEvents.getCount() - 1]; dbMeta->ofsLastEvent = DWORD(PBYTE(pLast) - m_pDbCache); @@ -283,7 +283,7 @@ BOOL CDb3Mmap::MetaMergeHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) pPrev->ofsNext = DWORD(PBYTE(pNext) - m_pDbCache); pNext->ofsPrev = DWORD(PBYTE(pPrev) - m_pDbCache); - if (dbMeta->ofsFirstUnread == 0 && !(pNext->flags & NOT_UNREAD)) + if (dbMeta->ofsFirstUnread == 0 && !pNext->markedRead()) dbMeta->ofsFirstUnread = pPrev->ofsNext; } } @@ -338,7 +338,7 @@ BOOL CDb3Mmap::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) dbSub.ofsFirstEvent = dwOffset; evCurr->ofsPrev = 0; } - if (dbSub.ofsFirstUnread == 0 && !(evCurr->flags & NOT_UNREAD)) { + if (dbSub.ofsFirstUnread == 0 && !evCurr->markedRead()) { dbSub.ofsFirstUnread = dwOffset; dbSub.tsFirstUnread = evCurr->timestamp; } @@ -355,7 +355,7 @@ BOOL CDb3Mmap::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) dbMeta.ofsFirstEvent = dwOffset; evCurr->ofsPrev = 0; } - if (dbMeta.ofsFirstUnread == 0 && !(evCurr->flags & NOT_UNREAD)) { + if (dbMeta.ofsFirstUnread == 0 && !evCurr->markedRead()) { dbMeta.ofsFirstUnread = dwOffset; dbMeta.tsFirstUnread = evCurr->timestamp; } -- cgit v1.2.3