Return a single phone number in JSON contacts list

This commit is contained in:
Francis Lachapelle
2015-03-10 13:27:17 -04:00
committed by Ludovic Marcotte
parent 42c382d2f7
commit 364e2fdcdf

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