mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 08:34:30 +00:00
Improve handling of mail delegates
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user