diff options
Diffstat (limited to 'plugins/Db3x_mmap/src/dbtool/eventchain.cpp')
-rw-r--r-- | plugins/Db3x_mmap/src/dbtool/eventchain.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
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;
|