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)
pull/69/head
Enrique J. Hernández Blasco 2014-10-14 23:48:36 +02:00 committed by Julio García
parent d076e04ad4
commit be60fdebcc
3 changed files with 15 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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