From 39e1ef53194f73d4ec875f5d4f640c037e563382 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 13 Jan 2022 08:42:07 -0500 Subject: [PATCH] fix(eas): handle module constraints Fixes #5456 --- ActiveSync/SOGoActiveSyncDispatcher.m | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 8ddb9aada..79a37020c 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -329,7 +329,9 @@ void handle_eas_terminate(int signum) case ActiveSyncEventFolder: case ActiveSyncTaskFolder: { - collection = [[[[context activeUser] homeFolderInContext: context] lookupName: @"Calendar" inContext: context acquire: NO] lookupName: theCollectionId inContext: context acquire: NO]; + collection = [[[context activeUser] homeFolderInContext: context] lookupName: @"Calendar" inContext: context acquire: NO]; + if (![collection isKindOfClass: [NSException class]]) + collection = [collection lookupName: theCollectionId inContext: context acquire: NO]; if (!collection || ([collection isKindOfClass: [NSException class]])) collection = nil; } @@ -1123,14 +1125,16 @@ void handle_eas_terminate(int signum) [[o properties] removeObjectForKey: @"CleanoutDate"]; [o save]; - + command_count++; } } + folders = [NSMutableArray array]; + // We get the list of subscribed calendars - folders = [[[[[context activeUser] homeFolderInContext: context] lookupName: @"Calendar" inContext: context acquire: NO] subFolders] mutableCopy]; - [folders autorelease]; + if ([personalFolderName length]) + [folders addObjectsFromArray: [[[[context activeUser] homeFolderInContext: context] lookupName: @"Calendar" inContext: context acquire: NO] subFolders]]; // We get the list of subscribed address books [folders addObjectsFromArray: [[[[context activeUser] homeFolderInContext: context] lookupName: @"Contacts" inContext: context acquire: NO] subFolders]];