Improve handling of mail delegates

pull/217/head
Francis Lachapelle 2016-07-06 15:35:09 -04:00
parent 0e8637ec9f
commit bfd3508949
3 changed files with 14 additions and 85 deletions

View File

@ -1100,7 +1100,7 @@ static NSString *inboxFolderName = @"INBOX";
max = [newDelegates count];
for (count = 0; count < max; count++)
{
currentDelegate = [newDelegates objectAtIndex: 0];
currentDelegate = [newDelegates objectAtIndex: count];
delegateUser = [SOGoUser userWithLogin: currentDelegate];
if (delegateUser)
{
@ -1127,7 +1127,7 @@ static NSString *inboxFolderName = @"INBOX";
max = [oldDelegates count];
for (count = 0; count < max; count++)
{
currentDelegate = [oldDelegates objectAtIndex: 0];
currentDelegate = [oldDelegates objectAtIndex: count];
delegateUser = [SOGoUser userWithLogin: currentDelegate];
if (delegateUser)
{

View File

@ -346,18 +346,22 @@ static Class NSNullK;
NSDictionary *contactInfos;
NSString *cn, *email, *fullEmail;
fullEmail = nil;
contactInfos = [self contactInfosForUserWithUIDorEmail: uid];
email = [contactInfos objectForKey: @"c_email"];
cn = [contactInfos objectForKey: @"cn"];
if ([cn length] > 0)
if (contactInfos)
{
if ([email length] > 0)
fullEmail = [NSString stringWithFormat: @"%@ <%@>", cn, email];
email = [contactInfos objectForKey: @"c_email"];
cn = [contactInfos objectForKey: @"cn"];
if ([cn length] > 0)
{
if ([email length] > 0)
fullEmail = [NSString stringWithFormat: @"%@ <%@>", cn, email];
else
fullEmail = cn;
}
else
fullEmail = cn;
fullEmail = email;
}
else
fullEmail = email;
return fullEmail;
}

View File

@ -24,84 +24,9 @@
#import <SOGoUI/UIxComponent.h>
@interface UIxMailUserDelegationEditor : UIxComponent
// {
// NSArray *delegates;
// NSString *currentDelegate;
// }
// - (NSArray *) delegates;
// - (void) setCurrentDelegate: (NSString *) newCurrentDelegate;
// - (NSString *) currentDelegate;
@end
@implementation UIxMailUserDelegationEditor
// - (id) init
// {
// if ((self = [super init]))
// {
// delegates = nil;
// currentDelegate = nil;
// }
// return self;
// }
// - (void) dealloc
// {
// [delegates release];
// [currentDelegate release];
// [super dealloc];
// }
// - (NSArray *) delegates
// {
// if (!delegates)
// {
// delegates = [[self clientObject] delegates];
// [delegates retain];
// }
// return delegates;
// }
// - (void) setCurrentDelegate: (NSString *) newCurrentDelegate
// {
// ASSIGN (currentDelegate, newCurrentDelegate);
// }
// - (NSString *) currentDelegate
// {
// return currentDelegate;
// }
// - (NSString *) currentDelegateDisplayName
// {
// SOGoUserManager *um;
// NSString *s;
// um = [SOGoUserManager sharedUserManager];
// s = ([currentDelegate hasPrefix: @"@"]
// ? [currentDelegate substringFromIndex: 1]
// : currentDelegate);
// return [um getFullEmailForUID: s];
// }
// - (id) defaultAction
// {
// id response;
// SOGoMailAccount *co;
// co = [self clientObject];
// if ([[co nameInContainer] isEqualToString: @"0"])
// response = self;
// else
// response = [self responseWithStatus: 403
// andString: @"The list of account delegates cannot be modified on secondary accounts."];
// return response;
// }
@end