From be60fdebcc1e92ab13ce93dcc019457e5c4d7722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Tue, 14 Oct 2014 23:48:36 +0200 Subject: [PATCH] oc-folder: Flags are now used in indexing db when deleting a msg Unregistering the URL in indexing db accordingly to the flags (SOFT or HARD) --- OpenChange/MAPIStoreFolder.m | 5 ++++- OpenChange/MAPIStoreMapping.h | 2 ++ OpenChange/MAPIStoreMapping.m | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/OpenChange/MAPIStoreFolder.m b/OpenChange/MAPIStoreFolder.m index a0455efb6..472f2b7c7 100644 --- a/OpenChange/MAPIStoreFolder.m +++ b/OpenChange/MAPIStoreFolder.m @@ -568,6 +568,8 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe struct mapistore_object_notification_parameters *notif_parameters; int rc; + /* flags that control the behaviour of the operation + (MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE) */ [self logWithFormat: @"-deleteMessageWithMID: mid: 0x%.16llx flags: %d", mid, flags]; mapping = [self mapping]; @@ -646,7 +648,8 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe notifyChangesForChild: message]; } [self logWithFormat: @"successfully deleted object at URL: %@", childURL]; - [mapping unregisterURLWithID: mid]; + /* Ensure we are respecting flags parameter */ + [mapping unregisterURLWithID: mid andFlags: flags]; [self cleanupCaches]; rc = MAPISTORE_SUCCESS; } diff --git a/OpenChange/MAPIStoreMapping.h b/OpenChange/MAPIStoreMapping.h index 620112d76..3210f1eb0 100644 --- a/OpenChange/MAPIStoreMapping.h +++ b/OpenChange/MAPIStoreMapping.h @@ -54,6 +54,8 @@ - (void) registerURLs: (NSArray *) urlString withIDs: (NSArray *) idNbrs; - (void) unregisterURLWithID: (uint64_t) idNbr; +- (void) unregisterURLWithID: (uint64_t) idNbr + andFlags: (uint8_t) flags; - (void) updateID: (uint64_t) idNbr withURL: (NSString *) urlString; diff --git a/OpenChange/MAPIStoreMapping.m b/OpenChange/MAPIStoreMapping.m index 516f1a079..1b2e4a0e7 100644 --- a/OpenChange/MAPIStoreMapping.m +++ b/OpenChange/MAPIStoreMapping.m @@ -278,4 +278,13 @@ MAPIStoreMappingKeyFromId (uint64_t idNbr) idNbr, MAPISTORE_PERMANENT_DELETE); } +- (void) unregisterURLWithID: (uint64_t) idNbr + andFlags: (uint8_t) flags +{ + indexing->del_fmid(indexing, [username UTF8String], + idNbr, + (flags == MAPISTORE_SOFT_DELETE) ? MAPISTORE_SOFT_DELETE : MAPISTORE_PERMANENT_DELETE); +} + + @end