Improve handling of mail delegates

This commit is contained in:
Francis Lachapelle
2016-07-06 15:35:09 -04:00
parent 09bda83bc8
commit f638113d53
3 changed files with 17 additions and 12 deletions
+2 -2
View File
@@ -1022,7 +1022,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)
{
@@ -1049,7 +1049,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)
{
+12 -8
View File
@@ -358,18 +358,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;
}
+3 -2
View File
@@ -84,14 +84,15 @@
- (NSString *) currentDelegateDisplayName
{
SOGoUserManager *um;
NSString *s;
NSString *s, *fullEmail;
um = [SOGoUserManager sharedUserManager];
s = ([currentDelegate hasPrefix: @"@"]
? [currentDelegate substringFromIndex: 1]
: currentDelegate);
fullEmail = [um getFullEmailForUID: s];
return [um getFullEmailForUID: s];
return fullEmail? fullEmail : currentDelegate;
}
- (id) defaultAction