From f78bdb7150aa9cb6fb9880c89cb7bb23cb05fea8 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 5 May 2011 18:34:13 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 60ea6e18203007e12287f19ec553de192b334dd6 Monotone-Revision: 4a2acb99fffd2f82c148ae17571304c2d05b9fba Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-05-05T18:34:13 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ UI/MailerUI/UIxMailAccountActions.m | 31 +++++++++++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) 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"],