From 6e2d8b12b96be3d84433b56332af31dc72fcf631 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 4 Feb 2011 16:07:29 +0000 Subject: [PATCH] Monotone-Parent: aac65a31ee08c38f3f5267343de6d090bbef6381 Monotone-Revision: 694600692b70cc30ffc96cddeb455dc83bc72078 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-02-04T16:07:29 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ OpenChange/SOGoMAPIFSMessage.m | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a03f024a2..0a19e3b1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-02-04 Wolfgang Sourdeau + * OpenChange/SOGoMAPIFSMessage.m (-MAPISave): use an alternative + way of producing the property list file as, for some reason, + invoking -writeToFile:atomically: can fail on NSDictionary. + * OpenChange/MAPIStoreContext.m (-deleteMessageWithMID:inFID:withFlags:): we need to invoke -cleanupCaches on the related table to avoid listing deleted diff --git a/OpenChange/SOGoMAPIFSMessage.m b/OpenChange/SOGoMAPIFSMessage.m index fa886a67f..3fb7505b4 100644 --- a/OpenChange/SOGoMAPIFSMessage.m +++ b/OpenChange/SOGoMAPIFSMessage.m @@ -24,6 +24,7 @@ #import #import #import +#import #import #import @@ -89,6 +90,7 @@ { NSArray *pathComponents; NSString *filePath; + NSData *content; [self logWithFormat: @"-MAPISave"]; @@ -108,7 +110,11 @@ return; } - if (![properties writeToFile: filePath atomically: YES]) + content = [NSPropertyListSerialization + dataFromPropertyList: properties + format: NSPropertyListOpenStepFormat + errorDescription: NULL]; + if (![content writeToFile: filePath atomically: NO]) [NSException raise: @"MAPIStoreIOException" format: @"could not save message"]; }