(fix) handle multi-valued mozillasecondemail attribute mapping

This commit is contained in:
Ludovic Marcotte
2018-07-20 09:44:20 -04:00
parent dc50bd2296
commit 396755fffb
2 changed files with 24 additions and 2 deletions
+18 -2
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: @""];