oc: Move back and forth folders now are in sync

Two different indexing entries were created on move operation making
impossible to restore old folder position in the original parent folder.
This was due to cleanupCaches message calls to objectId which requires
to have the indexing entry available.

Use case:

  * Restore a folder from "Deleted items" folders
pull/69/head
Enrique J. Hernández Blasco 2015-01-27 18:27:11 +01:00
parent 2dcb8fa732
commit b01de763da
1 changed files with 13 additions and 6 deletions

View File

@ -916,16 +916,23 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
}
if (isMove)
{
fmid = [mapping idFromURL: [self url]];
[mapping unregisterURLWithID: fmid];
[self deleteFolder];
[mapping registerURL: [newFolder url]
withID: fmid];
}
[targetFolder cleanupCaches];
}
[self cleanupCaches];
/* We perform the mapping operations at the
end as objectId is required to be available
until the caches are cleaned up */
if (isMove && rc == MAPISTORE_SUCCESS)
{
fmid = [mapping idFromURL: [self url]];
[mapping unregisterURLWithID: fmid];
[mapping registerURL: [newFolder url]
withID: fmid];
}
}
else
rc = MAPISTORE_ERR_DENIED;