mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 19:35:38 +00:00
Monotone-Parent: edf1f1831a73df9eb13881bab5ebdbcfa7c40a23
Monotone-Revision: d93bbab8d949fa50be1d182af68b2eecf4c79105 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-03-20T21:07:16 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
|
||||
2012-03-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoUserFolder.m (-davLastName, -davFirstName):
|
||||
quick and dirty implementation of those getters.
|
||||
|
||||
* OpenChange/MAPIStoreAppointmentWrapper.m (-_setupITIPContext):
|
||||
ensure method is uppercase.
|
||||
|
||||
|
||||
@@ -635,6 +635,54 @@
|
||||
getCNForUID: nameInContainer];
|
||||
}
|
||||
|
||||
/* For firstname and lastname, we handle "Firstname Blabla Lastname" and
|
||||
"Lastname, Firstname Blabla" */
|
||||
- (NSString *) davLastName
|
||||
{
|
||||
NSArray *parts;
|
||||
NSString *cn, *lastName;
|
||||
NSRange comma;
|
||||
|
||||
cn = [self davDisplayName];
|
||||
comma = [cn rangeOfString: @","];
|
||||
if (comma.location != NSNotFound)
|
||||
lastName = [[cn substringToIndex: comma.location]
|
||||
stringByTrimmingSpaces];
|
||||
else
|
||||
{
|
||||
parts = [cn componentsSeparatedByString: @" "];
|
||||
if ([parts count] > 0)
|
||||
lastName = [parts lastObject];
|
||||
else
|
||||
lastName = nil;
|
||||
}
|
||||
|
||||
return lastName;
|
||||
}
|
||||
|
||||
- (NSString *) davFirstName
|
||||
{
|
||||
NSArray *parts;
|
||||
NSString *subtext, *cn, *firstName;
|
||||
NSRange comma;
|
||||
|
||||
cn = [self davDisplayName];
|
||||
comma = [cn rangeOfString: @","];
|
||||
if (comma.location != NSNotFound)
|
||||
subtext = [[cn substringFromIndex: comma.location]
|
||||
stringByTrimmingSpaces];
|
||||
else
|
||||
subtext = cn;
|
||||
|
||||
parts = [subtext componentsSeparatedByString: @" "];
|
||||
if ([parts count] > 0)
|
||||
firstName = [parts objectAtIndex: 0];
|
||||
else
|
||||
firstName = nil;
|
||||
|
||||
return firstName;
|
||||
}
|
||||
|
||||
- (NSString *) davResourceId
|
||||
{
|
||||
return [NSString stringWithFormat: @"urn:uuid:%@", nameInContainer];
|
||||
|
||||
Reference in New Issue
Block a user