merge of '4ecd3497cd5054a2a36581280fa018f7c4d761de'

and 'd3e2768d395c5117bc0c0e5ce9913f9cea531223'

Monotone-Parent: 4ecd3497cd5054a2a36581280fa018f7c4d761de
Monotone-Parent: d3e2768d395c5117bc0c0e5ce9913f9cea531223
Monotone-Revision: f6a08c3b1afc336cd35006c90d8dbf33e7f88bf1

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-08-21T17:42:51
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-08-21 17:42:51 +00:00
3 changed files with 48 additions and 2 deletions
+2
View File
@@ -34,6 +34,8 @@
CardElement *workAdr;
}
- (NSString *) fullName;
@end
#endif /* UIXCONTACTVIEW_H */
+27 -1
View File
@@ -67,7 +67,7 @@
{
return [NSString stringWithFormat:
[self labelForKey: @"Card for %@"],
[card fn]];
[self fullName]];
}
- (NSString *) displayName
@@ -82,6 +82,32 @@
value: [card nickname]];
}
- (NSString *) fullName
{
NSArray *n;
NSString *fn;
unsigned int max;
fn = [card fn];
if ([fn length] == 0)
{
n = [card n];
if (n)
{
max = [n count];
if (max > 0)
{
if (max > 1)
fn = [NSString stringWithFormat: @"%@ %@", [n objectAtIndex: 1], [n objectAtIndex: 0]];
else
fn = [n objectAtIndex: 0];
}
}
}
return fn;
}
- (NSString *) primaryEmail
{
NSString *email, *mailTo;
+19 -1
View File
@@ -151,7 +151,7 @@
{
id <SOGoContactObject> contact;
NSArray *accounts, *contactsId;
NSString *firstAccount, *newLocation, *parameters, *folderId, *uid, *email;
NSString *firstAccount, *newLocation, *parameters, *folderId, *uid, *email, *n;
NSMutableString *fn;
NSEnumerator *uids;
NSMutableArray *addresses;
@@ -160,6 +160,7 @@
SOGoContactFolders *folders;
SOGoParentFolder *folder;
WORequest *request;
unsigned int max;
parameters = nil;
co = [self clientObject];
@@ -202,7 +203,24 @@
if (email)
{
email = [NSString stringWithFormat: @"<%@>", email];
// We append the contact's name
fn = [NSMutableString stringWithString: [card fn]];
if ([fn length] == 0)
{
n = [card n];
if (n)
{
max = [n count];
if (max > 0)
{
if (max > 1)
fn = [NSMutableString stringWithFormat: @"%@ %@", [n objectAtIndex: 1], [n objectAtIndex: 0]];
else
fn = [NSMutableString stringWithString: [n objectAtIndex: 0]];
}
}
}
if (fn)
{
[fn appendFormat: @" %@", email];