diff --git a/ChangeLog b/ChangeLog index 0d50a23a6..d42ae509f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-05-05 Ludovic Marcotte + + * UI/MailerUI/UIxMailAccountActions.m - fixed an issue + with namespace handling in Dovecot. We do not try + to swap the mailbox name, which can correspond to an + username if we are dealing with the top-level mailbox. + 2011-05-03 Francis Lachapelle * UI/WebServerResources/generic.js (onRowClick): in some cases diff --git a/UI/MailerUI/UIxMailAccountActions.m b/UI/MailerUI/UIxMailAccountActions.m index 5633f1313..7668dcfa1 100644 --- a/UI/MailerUI/UIxMailAccountActions.m +++ b/UI/MailerUI/UIxMailAccountActions.m @@ -133,18 +133,29 @@ // to the full name of the person. if (otherUsersFolderName && [currentFolder hasPrefix: otherUsersFolderName]) { - // We have a string like /Other Users/lmarcotte/... + // 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]]; - login = [pathComponents objectAtIndex: 2]; - userManager = [SOGoUserManager sharedUserManager]; - fullName = [userManager getCNForUID: login]; - [pathComponents removeObjectsInRange: NSMakeRange(0,3)]; - currentDisplayName = [NSString stringWithFormat: @"/%@/%@/%@", - [self labelForKey: @"OtherUsersFolderName"], - (fullName != nil ? fullName : login), - [pathComponents componentsJoinedByString: @"/"]]; - + if ([pathComponents count] > 2) + { + login = [pathComponents objectAtIndex: 2]; + userManager = [SOGoUserManager sharedUserManager]; + fullName = [userManager getCNForUID: login]; + [pathComponents removeObjectsInRange: NSMakeRange(0,3)]; + + currentDisplayName = [NSString stringWithFormat: @"/%@/%@/%@", + [self labelForKey: @"OtherUsersFolderName"], + (fullName != nil ? fullName : login), + [pathComponents componentsJoinedByString: @"/"]]; + + } + else + { + currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"OtherUsersFolderName"], + [currentFolder substringFromIndex: [otherUsersFolderName length]]]; + } } else if (sharedFoldersName && [currentFolder hasPrefix: sharedFoldersName]) currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"SharedFoldersName"],