merge of '2918fd48475c28fab3fffda506a3e755d3121d38'

and '46e53471ba15a415a840ddb058785b89b6415704'

Monotone-Parent: 2918fd48475c28fab3fffda506a3e755d3121d38
Monotone-Parent: 46e53471ba15a415a840ddb058785b89b6415704
Monotone-Revision: 4bfedf0d0ab8fc8042756a4922e29e7270a9c9c0

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-12-21T21:50:34
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau committed 2007-12-21 21:50:34 +00:00
commit 7574a9bb3a
2 files changed
+23 -7

No files matched your search

+15 -7
View File
@@ -104,20 +104,28 @@
NSMutableArray *emails;
emails = [NSMutableArray new];
mailTo = nil;
[emails addObjectsFromArray: [card childrenWithTag: @"email"]];
[emails removeObjectsInArray: [card childrenWithTag: @"email"
andAttribute: @"type"
havingValue: @"pref"]];
if ([emails count] > 1)
// We might not have a preferred item but rather something like this:
// EMAIL;TYPE=work:dd@ee.com
// EMAIL;TYPE=home:ff@gg.com
// In this case, we always return the last entry.
if ([emails count] > 0)
{
email = [[emails objectAtIndex: 0] value: 0];
mailTo = [NSString stringWithFormat: @"<a href=\"mailto:%@\""
@" onclick=\"return onContactMailTo(this);\">"
@"%@</a>", email, email];
email = [[emails objectAtIndex: [emails count]-1] value: 0];
if ([email caseInsensitiveCompare: [card preferredEMail]] != NSOrderedSame)
mailTo = [NSString stringWithFormat: @"<a href=\"mailto:%@\""
@" onclick=\"return onContactMailTo(this);\">"
@"%@</a>", email, email];
}
else
mailTo = nil;
[emails release];
return [self _cardStringWithLabel: @"Additional Email:"
value: mailTo];