From 43a02620a6a09076a184cb52986a9c0fca823d26 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 23 Feb 2012 21:14:02 +0000 Subject: [PATCH] Monotone-Parent: 3a9c8a7bada864ce6b83c04661c09d59c8ecf8d9 Monotone-Revision: 31ddf1e225a45a18cc6693f45745d82251abfd64 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-02-23T21:14:02 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ OpenChange/MAPIStoreContext.m | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c818c7a58..2cea02fd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2012-02-23 Wolfgang Sourdeau + * OpenChange/MAPIStoreContext.m + (+createRootFolder:withFID:andName:forUser:withRole:): when the + creation of a folder fails in the proper contact, fallback on the + fallback context. + * SoObjects/Mailer/SOGoMailAccount.m (-toManyRelationshipKeysWithNamespaces:): for some reason, we were explicitly returning the drafts folder name in the batch whether diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index 45f632349..81da9d4c6 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -185,12 +185,16 @@ MAPIStoreLookupContextClassByRole (Class self, enum mapistore_context_role role) contextClass = MAPIStoreFallbackContextK; mapistoreURI = [contextClass createRootSecondaryFolderWithFID: fid - andName: (NSString *) folderName + andName: folderName forUser: userName]; + if (!mapistoreURI && contextClass != MAPIStoreFallbackContextK) + mapistoreURI = [MAPIStoreFallbackContextK createRootSecondaryFolderWithFID: fid + andName: folderName + forUser: userName]; if (mapistoreURI) *mapistoreUriP = mapistoreURI; else - rc = MAPISTORE_ERROR; + rc = MAPISTORE_ERR_NOT_FOUND; return rc; }