Improve handling of mail delegates

This commit is contained in:
Francis Lachapelle
2016-07-06 15:35:09 -04:00
parent 0e8637ec9f
commit bfd3508949
3 changed files with 14 additions and 85 deletions
+12 -8
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;
}