From d2b739d261a01652307972b0def1ffc0074ddffa Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 24 Sep 2013 16:01:23 -0400 Subject: [PATCH] Fix for bug #2318 --- NEWS | 4 +++- UI/MailerUI/UIxMailAccountActions.m | 19 +++++++++++-------- UI/WebServerResources/MailerUI.js | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index abfb071d6..7d5c295d2 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Enhancements - The init scripts now start 3 sogod processes by default instead of 1 - SOGo now also sends a plain/text parts when sending HTML mails (#2217) - SOGo now listens on 127.0.0.1:20000 by default (instead of *:20000) + - SOGo new uses the latest WebDAV sync response type (#1275) Bug fixes - Fixed Finnish mail reply/forward templates (#2401) @@ -25,8 +26,9 @@ Bug fixes - Worked around an issue with chunked encoding of CAS replies (#2408) - Avoid crash when handling malformed or non-ASCII http credentials (#2358) - Fixed crontab error (#2372) - - Fixed OpenChange corruption issue regarding predecessors change list + - Fixed OpenChange corruption issue regarding predecessors change list (#2405) - Avoid using too many LDAP connections while looping through ldap results + - Avoid unnecessary UTF-7 conversions (#2318) 2.0.7 (2013-07-19) ------------------ diff --git a/UI/MailerUI/UIxMailAccountActions.m b/UI/MailerUI/UIxMailAccountActions.m index 2b3c293d6..f3b519728 100644 --- a/UI/MailerUI/UIxMailAccountActions.m +++ b/UI/MailerUI/UIxMailAccountActions.m @@ -32,6 +32,7 @@ #import #import #import +#import #import #import @@ -123,7 +124,7 @@ - (NSArray *) _jsonFolders: (NSEnumerator *) rawFolders { - NSString *currentFolder, *currentDisplayName, *currentFolderType, *login, *fullName; + NSString *currentFolder, *currentDecodedFolder, *currentDisplayName, *currentFolderType, *login, *fullName; NSMutableArray *pathComponents; SOGoUserManager *userManager; NSDictionary *folderData; @@ -138,17 +139,19 @@ // are never reused and "autoreleased" at the end. This loop would consume // lots of LDAP connections during its execution. pool = [[NSAutoreleasePool alloc] init]; - currentFolderType = [self _folderType: currentFolder]; + + currentDecodedFolder = [currentFolder stringByDecodingImap4FolderName]; + currentFolderType = [self _folderType: currentDecodedFolder]; // We translate the "Other Users" and "Shared Folders" namespaces. // While we're at it, we also translate the user's mailbox names // to the full name of the person. - if (otherUsersFolderName && [currentFolder hasPrefix: otherUsersFolderName]) + if (otherUsersFolderName && [currentDecodedFolder hasPrefix: otherUsersFolderName]) { // We have a string like /Other Users/lmarcotte/... under Cyrus, but we could // also have something like /shared under Dovecot. So we swap the username only // if we have one, of course. - pathComponents = [NSMutableArray arrayWithArray: [currentFolder pathComponents]]; + pathComponents = [NSMutableArray arrayWithArray: [currentDecodedFolder pathComponents]]; if ([pathComponents count] > 2) { @@ -166,14 +169,14 @@ else { currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"OtherUsersFolderName"], - [currentFolder substringFromIndex: [otherUsersFolderName length]]]; + [currentDecodedFolder substringFromIndex: [otherUsersFolderName length]]]; } } - else if (sharedFoldersName && [currentFolder hasPrefix: sharedFoldersName]) + else if (sharedFoldersName && [currentDecodedFolder hasPrefix: sharedFoldersName]) currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"SharedFoldersName"], - [currentFolder substringFromIndex: [sharedFoldersName length]]]; + [currentDecodedFolder substringFromIndex: [sharedFoldersName length]]]; else - currentDisplayName = currentFolder; + currentDisplayName = currentDecodedFolder; folderData = [NSDictionary dictionaryWithObjectsAndKeys: currentFolder, @"path", diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index 99f646504..ae01d7654 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -774,7 +774,7 @@ function composeNewMessage() { function openMailbox(mailbox, reload) { if (mailbox != Mailer.currentMailbox || reload) { - var url = ApplicationBaseURL + encodeURI(mailbox); + var url = ApplicationBaseURL + encodeURI(mailbox.unescapeHTML()); var urlParams = new Hash(); if (!reload) {