(fix) handle multi-valued mozillasecondemail attribute mapping

pull/229/merge
Ludovic Marcotte 2018-07-20 09:44:20 -04:00
parent dc50bd2296
commit 396755fffb
2 changed files with 24 additions and 2 deletions

6
NEWS
View File

@ -1,3 +1,9 @@
4.x.x (2018-xx-xx)
------------------
Bug fixes
- [core] handle multi-valued mozillasecondemail attribute mapping
4.0.1 (2018-07-10)
------------------

View File

@ -274,8 +274,24 @@ convention:
}
}
homeMail = [self elementWithTag: @"email" ofType: @"home"];
[homeMail setSingleValue: [ldifRecord objectForKey: @"mozillasecondemail"] forKey: @""];
mail = [ldifRecord objectForKey: @"mozillasecondemail"];
if ([mail isKindOfClass: [NSArray class]])
{
mailList = [(NSArray *)mail objectEnumerator];
while ((mail = [mailList nextObject]))
{
if ([mail length] && ![emails containsObject: mail])
[self addElementWithTag: @"email"
ofType: @"home"
withValue: mail];
}
}
else
{
homeMail = [self elementWithTag: @"email" ofType: @"home"];
[homeMail setSingleValue: mail forKey: @""];
}
[[self uniqueChildWithTag: @"x-mozilla-html"]
setSingleValue: [ldifRecord objectForKey: @"mozillausehtmlmail"]
forKey: @""];