Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid duplicate emails in LDAP-based address book
Fixes #3941
  • Loading branch information
cgx committed Dec 21, 2016
1 parent 94c522e commit 7327ec2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -24,6 +24,7 @@ Bug fixes
- [web] fixed display of message content when enabling auto-reply (#3940)
- [web] don't allow to create lists in a remote address book (not yet supported)
- [web] fixed attached links in task viewer (#3963)
- [web] avoid duplicate mail entries in contact of LDAP-based address book (#3941)
- [eas] properly skip folders we don't want to synchronize (#3943)
- [eas] fixed 30 mins freebusy offset with S Planner
- [eas] now correctly handles reminders on tasks (#3964)
Expand Down
1 change: 1 addition & 0 deletions SoObjects/Contacts/NGVCard+SOGo.h
Expand Up @@ -40,6 +40,7 @@

- (NSString *) workCompany;
- (NSString *) fullName;
- (NSArray *) emails;
- (NSArray *) secondaryEmails;

- (NSString *) workPhone;
Expand Down
9 changes: 6 additions & 3 deletions SoObjects/Contacts/NGVCard+SOGo.m
Expand Up @@ -236,16 +236,19 @@ - (void) _setPhoneValues: (NSDictionary *) ldifRecord
- (void) _setEmails: (NSDictionary *) ldifRecord
{
CardElement *homeMail;
NSString* mail;

// Emails from the configured mail fields of the source have already been extracted in
// [LDAPSource _fillEmailsOfEntry:intoLDIFRecord:]
[self addElementWithTag: @"email"
ofType: @"work"
withValue: [ldifRecord objectForKey: @"c_emails"]];
// When importing an LDIF file, add the default mail attribute
[self addElementWithTag: @"email"
ofType: @"work"
withValue: [ldifRecord objectForKey: @"mail"]];
mail = [ldifRecord objectForKey: @"mail"];
if ([mail length] && ![[self emails] containsObject: mail])
[self addElementWithTag: @"email"
ofType: @"work"
withValue: [ldifRecord objectForKey: @"mail"]];
homeMail = [self elementWithTag: @"email" ofType: @"home"];
[homeMail setSingleValue: [ldifRecord objectForKey: @"mozillasecondemail"] forKey: @""];
[[self uniqueChildWithTag: @"x-mozilla-html"]
Expand Down

0 comments on commit 7327ec2

Please sign in to comment.