fix(eas): handle module constraints

Fixes #5456
This commit is contained in:
Francis Lachapelle
2022-01-13 08:42:07 -05:00
parent b7171be1da
commit 39e1ef5319

View File

@@ -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]];