Return a single phone number in JSON contacts list

pull/72/head
Francis Lachapelle 2015-03-10 13:27:17 -04:00
parent 517f4b0f49
commit f1fda8bd06
1 changed files with 7 additions and 0 deletions

View File

@ -267,6 +267,13 @@
data = [oldRecord objectForKey: @"homephone"];
if (![data length])
data = @"";
else if ([data isKindOfClass: [NSArray class]])
{
if ([data count] > 0)
data = [data objectAtIndex: 0];
else
data = @"";
}
[newRecord setObject: data forKey: @"c_telephonenumber"];
// Custom attribute for group-lookups. See LDAPSource.m where