From 884fbfdb7359db6a24057a4f958db6a563e04944 Mon Sep 17 00:00:00 2001 From: Jean Raby Date: Fri, 15 Nov 2013 13:17:37 -0500 Subject: [PATCH] Bump copyright and fix whitespace (tab kill) --- UI/MailerUI/UIxMailAccountActions.m | 96 +++++++++++++++-------------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/UI/MailerUI/UIxMailAccountActions.m b/UI/MailerUI/UIxMailAccountActions.m index f3b519728..c7d1d45f3 100644 --- a/UI/MailerUI/UIxMailAccountActions.m +++ b/UI/MailerUI/UIxMailAccountActions.m @@ -1,6 +1,6 @@ /* UIxMailAccountActions.m - this file is part of SOGo * - * Copyright (C) 2007-2011 Inverse inc. + * Copyright (C) 2007-2013 Inverse inc. * * Author: Wolfgang Sourdeau * Ludovic Marcotte @@ -87,21 +87,21 @@ { co = [self clientObject]; specialFolders = [[NSArray arrayWithObjects: - [co inboxFolderNameInContext: context], - [co draftsFolderNameInContext: context], - [co sentFolderNameInContext: context], - [co trashFolderNameInContext: context], - [co otherUsersFolderNameInContext: context], - [co sharedFoldersNameInContext: context], - nil] stringsWithFormat: @"/%@"]; + [co inboxFolderNameInContext: context], + [co draftsFolderNameInContext: context], + [co sentFolderNameInContext: context], + [co trashFolderNameInContext: context], + [co otherUsersFolderNameInContext: context], + [co sharedFoldersNameInContext: context], + nil] stringsWithFormat: @"/%@"]; ASSIGN(inboxFolderName, [specialFolders objectAtIndex: 0]); ASSIGN(draftsFolderName, [specialFolders objectAtIndex: 1]); ASSIGN(sentFolderName, [specialFolders objectAtIndex: 2]); ASSIGN(trashFolderName, [specialFolders objectAtIndex: 3]); if ([specialFolders count] > 4) - ASSIGN(otherUsersFolderName, [specialFolders objectAtIndex: 4]); + ASSIGN(otherUsersFolderName, [specialFolders objectAtIndex: 4]); if ([specialFolders count] > 5) - ASSIGN(sharedFoldersName, [specialFolders objectAtIndex: 5]); + ASSIGN(sharedFoldersName, [specialFolders objectAtIndex: 5]); } if ([folderName isEqualToString: inboxFolderName]) @@ -147,42 +147,44 @@ // While we're at it, we also translate the user's mailbox names // to the full name of the person. 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: [currentDecodedFolder pathComponents]]; - - 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"], - [currentDecodedFolder substringFromIndex: [otherUsersFolderName length]]]; - } - } + { + // 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: [currentDecodedFolder pathComponents]]; + + 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"], + [currentDecodedFolder substringFromIndex: + [otherUsersFolderName length]]]; + } + } else if (sharedFoldersName && [currentDecodedFolder hasPrefix: sharedFoldersName]) - currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"SharedFoldersName"], - [currentDecodedFolder substringFromIndex: [sharedFoldersName length]]]; + currentDisplayName = [NSString stringWithFormat: @"/%@%@", [self labelForKey: @"SharedFoldersName"], + [currentDecodedFolder substringFromIndex: [sharedFoldersName length]]]; else - currentDisplayName = currentDecodedFolder; - + currentDisplayName = currentDecodedFolder; + folderData = [NSDictionary dictionaryWithObjectsAndKeys: - currentFolder, @"path", - currentFolderType, @"type", - currentDisplayName, @"displayName", - nil]; + currentFolder, @"path", + currentFolderType, @"type", + currentDisplayName, @"displayName", + nil]; [folders addObject: folderData]; [pool release]; } @@ -207,7 +209,7 @@ response = [self responseWithStatus: 200 andString: [data jsonRepresentation]]; [response setHeader: @"application/json" - forKey: @"content-type"]; + forKey: @"content-type"]; return response; } @@ -256,7 +258,7 @@ nl = ([[[[context activeUser] userDefaults] mailComposeMessageType] isEqualToString: @"html"] ? @"
" : @"\n"); [newDraftMessage - setText: [NSString stringWithFormat: @"%@%@-- %@%@", nl, nl, nl, signature]]; + setText: [NSString stringWithFormat: @"%@%@-- %@%@", nl, nl, nl, signature]]; save = YES; } if (save) @@ -264,8 +266,8 @@ urlBase = [newDraftMessage baseURLInContext: context]; url = [urlBase composeURLWithAction: @"edit" - parameters: nil - andHash: NO]; + parameters: nil + andHash: NO]; return [self redirectToLocation: url]; }