diff --git a/ChangeLog b/ChangeLog index c63d43685..2df7c4a48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-01-05 Wolfgang Sourdeau + * OpenChange/SOGoMAPIFSMessage.m (-MAPISave): make use of + "ensureDirectory" on the container folder to avoid errors with + NSDictionary failing to save itself to the filesystem. + + * OpenChange/SOGoMAPIFSFolder.m (-ensureDirectory): method made + public and which ensures that the directory pointed to by the + instances of this class does exist. + * OpenChange/SOGoContactGCSEntry+MAPIStore.m (-setMAPIProperties): take "PidLidEmail1EmailAddress" id as key for the contact email address. diff --git a/OpenChange/SOGoMAPIFSFolder.h b/OpenChange/SOGoMAPIFSFolder.h index 43c836323..ab36dbe58 100644 --- a/OpenChange/SOGoMAPIFSFolder.h +++ b/OpenChange/SOGoMAPIFSFolder.h @@ -43,6 +43,7 @@ - (NSString *) directory; - (SOGoMAPIFSMessage *) newMessage; +- (void) ensureDirectory; @end diff --git a/OpenChange/SOGoMAPIFSFolder.m b/OpenChange/SOGoMAPIFSFolder.m index 5c44d4b1d..eaaf2386c 100644 --- a/OpenChange/SOGoMAPIFSFolder.m +++ b/OpenChange/SOGoMAPIFSFolder.m @@ -133,7 +133,7 @@ static NSString *privateDir = nil; return [SOGoMAPIFSMessage objectWithName: filename inContainer: self]; } -- (void) _ensureDirectorySanity +- (void) ensureDirectory { NSFileManager *fm; NSDictionary *attributes; @@ -169,7 +169,7 @@ static NSString *privateDir = nil; BOOL isDir; if (!directoryIsSane) - [self _ensureDirectorySanity]; + [self ensureDirectory]; fm = [NSFileManager defaultManager]; contents = [fm directoryContentsAtPath: directory]; @@ -208,7 +208,7 @@ static NSString *privateDir = nil; BOOL isDir; if (!directoryIsSane) - [self _ensureDirectorySanity]; + [self ensureDirectory]; fm = [NSFileManager defaultManager]; fullName = [directory stringByAppendingPathComponent: fileName]; diff --git a/OpenChange/SOGoMAPIFSMessage.m b/OpenChange/SOGoMAPIFSMessage.m index 329475bed..19daa6bdb 100644 --- a/OpenChange/SOGoMAPIFSMessage.m +++ b/OpenChange/SOGoMAPIFSMessage.m @@ -74,6 +74,8 @@ [self logWithFormat: @"-MAPISave"]; + [container ensureDirectory]; + filePath = [[container directory] stringByAppendingPathComponent: nameInContainer]; if (![properties writeToFile: filePath atomically: YES])