Monotone-Parent: bef1f662e1701b836a89ce52809aac40d4c7a964

Monotone-Revision: d3e2768d395c5117bc0c0e5ce9913f9cea531223

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-08-21T17:42:31
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-08-21 17:42:31 +00:00
parent 4215ddc817
commit dd7412cbf1
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];