summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-06 22:24:24 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-06 22:24:24 +0000
commit95eb632edba7de5e81ef42d0e8f7d04805b0638b (patch)
tree46a4dc0cbbf3fc39761d8603400dd92bb88d8268 /plugins/Db3x_mmap
parent77d547491a43208f615b8c5370b30677dab19858 (diff)
fix for the first unread event calculation during merge/split
git-svn-id: http://svn.miranda-ng.org/main/trunk@8438 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r--plugins/Db3x_mmap/src/dbcontacts.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp
index b180a89752..0d16cefa0b 100644
--- a/plugins/Db3x_mmap/src/dbcontacts.cpp
+++ b/plugins/Db3x_mmap/src/dbcontacts.cpp
@@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
+#define NOT_UNREAD (DBEF_READ | DBEF_SENT)
+
int CDb3Mmap::CheckProto(DBCachedContact *cc, const char *proto)
{
if (cc->szProto == NULL) {
@@ -266,7 +268,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 & DBEF_READ) ? 0 : dbMeta->ofsFirstEvent;
+ dbMeta->ofsFirstUnread = (pFirst->flags & NOT_UNREAD) ? 0 : dbMeta->ofsFirstEvent;
DBEvent *pLast = arEvents[arEvents.getCount()-1];
dbMeta->ofsLastEvent = DWORD(PBYTE(pLast) - m_pDbCache);
@@ -277,7 +279,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 & DBEF_READ))
+ if (dbMeta->ofsFirstUnread == 0 && !(pNext->flags & NOT_UNREAD))
dbMeta->ofsFirstUnread = pPrev->ofsNext;
}
}
@@ -334,7 +336,7 @@ BOOL CDb3Mmap::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub)
dbSub.ofsFirstEvent = dwOffset;
evCurr->ofsPrev = 0;
}
- if (dbSub.ofsFirstUnread == 0 && !(evCurr->flags & DBEF_READ)) {
+ if (dbSub.ofsFirstUnread == 0 && !(evCurr->flags & NOT_UNREAD)) {
dbSub.ofsFirstUnread = dwOffset;
dbSub.tsFirstUnread = evCurr->timestamp;
}
@@ -351,7 +353,7 @@ BOOL CDb3Mmap::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub)
dbMeta.ofsFirstEvent = dwOffset;
evCurr->ofsPrev = 0;
}
- if (dbMeta.ofsFirstUnread == 0 && !(evCurr->flags & DBEF_READ)) {
+ if (dbMeta.ofsFirstUnread == 0 && !(evCurr->flags & NOT_UNREAD)) {
dbMeta.ofsFirstUnread = dwOffset;
dbMeta.tsFirstUnread = evCurr->timestamp;
}