Bump copyright and fix whitespace (tab kill)

pull/15/merge
Jean Raby 2013-11-15 13:17:37 -05:00
parent c05cf00db7
commit 884fbfdb73
1 changed files with 49 additions and 47 deletions

View File

@ -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 <wsourdeau@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
@ -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"] ? @"<br/>" : @"\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];
}