summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}