From e29d14de96780c49a02995c45375a3b24bed8950 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 30 Jun 2016 09:30:22 -0400 Subject: [PATCH] (fix) handle missing IMAP folders from a hierarchy using EAS --- ActiveSync/SOGoActiveSyncDispatcher.m | 10 +++++++--- NEWS | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 300e3c308..d301a7109 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -716,6 +716,7 @@ void handle_eas_terminate(int signum) - (void) _flattenFolders: (NSArray *) theFolders into: (NSMutableArray *) theTarget parent: (NSString *) theParent + parentType: (NSString *) theParentType { NSArray *o; int i; @@ -724,13 +725,16 @@ void handle_eas_terminate(int signum) for (i = 0; i < [theFolders count]; i++) { - if (theParent) + if (theParent && ![theParentType isEqualToString: @"additional"]) [[theFolders objectAtIndex: i] setObject: theParent forKey: @"parent"]; + if ([theParentType isEqualToString: @"additional"]) + [[theFolders objectAtIndex: i] setObject: [[theFolders objectAtIndex: i] objectForKey: @"path"] forKey: @"name"]; + o = [[theFolders objectAtIndex: i] objectForKey: @"children"]; if (o) - [self _flattenFolders: o into: theTarget parent: [[theFolders objectAtIndex: i] objectForKey: @"path"]]; + [self _flattenFolders: o into: theTarget parent: [[theFolders objectAtIndex: i] objectForKey: @"path"] parentType: [[theFolders objectAtIndex: i] objectForKey: @"type"]]; } } @@ -804,7 +808,7 @@ void handle_eas_terminate(int signum) } allFoldersMetadata = [NSMutableArray array]; - [self _flattenFolders: [accountFolder allFoldersMetadata] into: allFoldersMetadata parent: nil]; + [self _flattenFolders: [accountFolder allFoldersMetadata] into: allFoldersMetadata parent: nil parentType: nil]; // Get GUIDs of folder (IMAP) // e.g. {folderINBOX = folder6b93c528176f1151c7260000aef6df92} diff --git a/NEWS b/NEWS index 83a6a0866..66ec27344 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ Bug fixes - [web] fixed crash when an attachment filename has no extension - [web] fixed selection of transparent all-day events (#3744) - [eas] handle base64 EAS protocol version + - [eas] handle missing IMAP folders from a hierarchy using EAS 3.1.3 (2016-06-22) ------------------