small fix in previous commit

Monotone-Parent: 7b7bd2c2a5b03397fa881da7976214adc4635a4a
Monotone-Revision: 46e53471ba15a415a840ddb058785b89b6415704

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2007-12-21T18:23:48
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte 2007-12-21 18:23:48 +00:00
parent f6bff0a7bd
commit 6f6b695abe

View file

@ -104,8 +104,9 @@
NSMutableArray *emails;
emails = [NSMutableArray new];
[emails addObjectsFromArray: [card childrenWithTag: @"email"]];
mailTo = nil;
[emails addObjectsFromArray: [card childrenWithTag: @"email"]];
[emails removeObjectsInArray: [card childrenWithTag: @"email"
andAttribute: @"type"
havingValue: @"pref"]];
@ -117,12 +118,12 @@
if ([emails count] > 0)
{
email = [[emails objectAtIndex: [emails count]-1] value: 0];
mailTo = [NSString stringWithFormat: @"<a href=\"mailto:%@\""
@" onclick=\"return onContactMailTo(this);\">"
@"%@</a>", email, email];
if ([email caseInsensitiveCompare: [card preferredEMail]] != NSOrderedSame)
mailTo = [NSString stringWithFormat: @"<a href=\"mailto:%@\""
@" onclick=\"return onContactMailTo(this);\">"
@"%@</a>", email, email];
}
else
mailTo = nil;
[emails release];