From e0ed9d34c0c21d3436e855fa1d32a0f824583116 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 13 Mar 2014 12:46:12 +0000 Subject: another atavism died: DBEF_FIRST git-svn-id: http://svn.miranda-ng.org/main/trunk@8590 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbtool/eventchain.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbtool') diff --git a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp index ee3cb7b854..fd988fe2cc 100644 --- a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp +++ b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "..\commonheaders.h" -#define DBEF_ALL (DBEF_FIRST | DBEF_READ | DBEF_SENT | DBEF_RTL | DBEF_UTF | DBEF_ENCRYPTED) +#define DBEF_ALL (DBEF_READ | DBEF_SENT | DBEF_RTL | DBEF_UTF | DBEF_ENCRYPTED) static BOOL backLookup; static DWORD ofsThisEvent, ofsPrevEvent; @@ -174,17 +174,15 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime) } if (firstTime) { - if (!(dbeOld.flags & DBEF_FIRST)) { + if (dbeOld.ofsPrev != 0) cb->pfnAddLogMessage(STATUS_WARNING, TranslateT("First event not marked as such: correcting")); - dbeOld.flags |= DBEF_FIRST; - } - dbeOld.ofsPrev = ofsContact; + + dbeOld.ofsPrev = 0; lastTimestamp = dbeOld.timestamp; } - else if (dbeOld.flags & DBEF_FIRST) { - cb->pfnAddLogMessage(STATUS_WARNING, TranslateT("Event marked as first which is not: correcting")); - dbeOld.flags &= ~DBEF_FIRST; - } + + if (dbeOld.flags & 1) + dbeOld.flags &= ~1; if (dbeOld.flags & ~DBEF_ALL) { cb->pfnAddLogMessage(STATUS_WARNING, TranslateT("Extra flags found in event: removing")); @@ -309,8 +307,7 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime) // insert before FIRST if (found == 1 && !cb->bCheckOnly) { - dbeNew->flags |= DBEF_FIRST; - dbeNew->ofsPrev = ofsContact; + dbeNew->ofsPrev = 0; dbeNew->ofsNext = dbc->ofsFirstEvent; ofsDestThis = WriteEvent(dbeNew); @@ -325,8 +322,6 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime) WriteOfsNextToPrevious(0, dbc, ofsDestThis); // fix next event WriteSegment(dbeNew->ofsNext + offsetof(DBEvent, ofsPrev), &ofsDestThis, sizeof(DWORD)); - dbeTmp.flags &= ~DBEF_FIRST; - WriteSegment(dbeNew->ofsNext + offsetof(DBEvent, flags), &dbeTmp.flags, sizeof(DWORD)); } else if (found == 2 && !cb->bCheckOnly) { dbeNew->ofsPrev = ofsTmp; -- cgit v1.2.3