From 39cdd8419b3fc55a6018e1f1e3eac24c2779f507 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 26 Apr 2011 13:10:40 +0000 Subject: [PATCH] Small fix for servers that don't have NAMESPACE Monotone-Parent: 5de6a9584cf27a2c1dad8d1ab8b84fc9ddab2720 Monotone-Revision: 8fb65e4ddd95ab6be36dc4834118f0f4c9e565bc Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-04-26T13:10:40 Monotone-Branch: ca.inverse.sogo --- UI/MailerUI/UIxMailAccountActions.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/UI/MailerUI/UIxMailAccountActions.m b/UI/MailerUI/UIxMailAccountActions.m index 594bf2bc5..20c772724 100644 --- a/UI/MailerUI/UIxMailAccountActions.m +++ b/UI/MailerUI/UIxMailAccountActions.m @@ -95,8 +95,10 @@ ASSIGN(draftsFolderName, [specialFolders objectAtIndex: 1]); ASSIGN(sentFolderName, [specialFolders objectAtIndex: 2]); ASSIGN(trashFolderName, [specialFolders objectAtIndex: 3]); - ASSIGN(otherUsersFolderName, [specialFolders objectAtIndex: 4]); - ASSIGN(sharedFoldersName, [specialFolders objectAtIndex: 5]); + if ([specialFolders count] == 5) + ASSIGN(otherUsersFolderName, [specialFolders objectAtIndex: 4]); + if ([specialFolders count] == 6) + ASSIGN(sharedFoldersName, [specialFolders objectAtIndex: 5]); } if ([folderName isEqualToString: inboxFolderName]) @@ -129,7 +131,7 @@ // 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 ([currentFolder hasPrefix: otherUsersFolderName]) + if (otherUsersFolderName && [currentFolder hasPrefix: otherUsersFolderName]) { // We have a string like /Other Users/lmarcotte/... pathComponents = [NSMutableArray arrayWithArray: [currentFolder pathComponents]]; @@ -144,7 +146,7 @@ [pathComponents componentsJoinedByString: @"/"]]; } - else if ([currentFolder hasPrefix: sharedFoldersName]) + else if (sharedFoldersName && [currentFolder hasPrefix: sharedFoldersName]) currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"SharedFoldersName"], [currentFolder substringFromIndex: [sharedFoldersName length]]]; else