diff --git a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m index 950ee4769..fd11cf0b5 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m +++ b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m @@ -159,7 +159,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. NSString *nameInCache; if (theFolderType == ActiveSyncMailFolder) - nameInCache= [[[theCollection mailAccountFolder] imapFolderGUIDs] objectForKey: [theCollection nameInContainer]]; + nameInCache = [imapFolderGUIDS objectForKey: [theCollection nameInContainer]]; else { NSString *component_name; @@ -170,7 +170,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. else component_name = @"vtodo"; - nameInCache= [NSString stringWithFormat: @"%@/%@", component_name, [theCollection nameInContainer]]; + nameInCache = [NSString stringWithFormat: @"%@/%@", component_name, [theCollection nameInContainer]]; } return nameInCache; diff --git a/ActiveSync/SOGoActiveSyncDispatcher.h b/ActiveSync/SOGoActiveSyncDispatcher.h index d72073ad1..affe9e5b9 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.h +++ b/ActiveSync/SOGoActiveSyncDispatcher.h @@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @interface SOGoActiveSyncDispatcher : NSObject { NSURL *folderTableURL; + NSDictionary *imapFolderGUIDS; id context; } diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 9be2ebe62..ddfcb57fe 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -151,12 +151,14 @@ static BOOL debugOn = NO; debugOn = [[SOGoSystemDefaults sharedSystemDefaults] easDebugEnabled]; folderTableURL = nil; + imapFolderGUIDS = nil; return self; } - (void) dealloc { RELEASE(folderTableURL); + RELEASE(imapFolderGUIDS); [super dealloc]; } @@ -229,23 +231,27 @@ static BOOL debugOn = NO; SOGoMailAccounts *accountsFolder; SOGoMailAccount *accountFolder; SOGoUserFolder *userFolder; - NSDictionary *imapGUIDs; - userFolder = [[context activeUser] homeFolderInContext: context]; - accountsFolder = [userFolder lookupName: @"Mail" inContext: context acquire: NO]; - accountFolder = [accountsFolder lookupName: @"0" inContext: context acquire: NO]; - - // Get the GUID of the IMAP folder - imapGUIDs = [accountFolder imapFolderGUIDs]; - - //return [[imapGUIDs allKeysForObject: theIdToTranslate] objectAtIndex: 0]; - return [[[imapGUIDs allKeysForObject: [NSString stringWithFormat: @"folder%@", theIdToTranslate]] objectAtIndex: 0] substringFromIndex: 6] ; + if (!imapFolderGUIDS) + { + userFolder = [[context activeUser] homeFolderInContext: context]; + accountsFolder = [userFolder lookupName: @"Mail" inContext: context acquire: NO]; + accountFolder = [accountsFolder lookupName: @"0" inContext: context acquire: NO]; + + // Get the GUID of the IMAP folder + imapFolderGUIDS = [accountFolder imapFolderGUIDs]; + [imapFolderGUIDS retain]; + + } + + return [[[imapFolderGUIDS allKeysForObject: [NSString stringWithFormat: @"folder%@", theIdToTranslate]] objectAtIndex: 0] substringFromIndex: 6] ; } return theIdToTranslate; } + // // // diff --git a/NEWS b/NEWS index 24ccfe94e..0d8e75d3a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ 2.3.x (2015-MM-DD) ------------------ +Enhancements + - improved EAS speed and memory usage, avoiding many IMAP LIST commands (#3294) + Bug fixes - fixed display of whitelisted attendees in Preferences window on Firefox (#3285) - Non-latin subfolder names are displayed correctly on Outlook (Zentyal)