diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 36e38bb2b..e9264283d 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -2109,13 +2109,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. inResponse: (WOResponse *) theResponse { SOGoContactSourceFolder *currentFolder; + NSArray *allKeys, *allContacts, *mails; NSDictionary *systemSources, *contact; + NSString *name, *query, *current_mail; SOGoContactFolders *contactFolders; - NSArray *allKeys, *allContacts; SOGoUserFolder *userFolder; - NSString *name, *query; NSMutableString *s; NSData *d; + id o; int i, j, total; @@ -2166,18 +2167,50 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // We get the LDIF entry of our record, for easier processing contact = [[currentFolder lookupName: [contact objectForKey: @"c_name"] inContext: context acquire: NO] ldifRecord]; - - [s appendString: @""]; - [s appendString: @""]; - [s appendFormat: @"%@", [contact objectForKey: @"displayname"]]; - [s appendFormat: @"%@", [contact objectForKey: @"givenname"]]; - [s appendFormat: @"%@", [contact objectForKey: @"sn"]]; - [s appendFormat: @"%@", [contact objectForKey: @"mail"]]; - [s appendFormat: @"%@", [contact objectForKey: @"telephonenumber"]]; - [s appendFormat: @"%@", [contact objectForKey: @"o"]]; - [s appendString: @""]; - [s appendString: @""]; - total++; + + o = [contact objectForKey: @"mail"]; + if ([o isKindOfClass: [NSArray class]]) + mails = o; + else + mails = [NSArray arrayWithObjects: o ? o : @"", nil]; + + for (total = 0; total < [mails count]; total++) + { + current_mail = [mails objectAtIndex: total]; + + [s appendString: @""]; + [s appendString: @""]; + + if ((o = [contact objectForKey: @"displayname"])) + [s appendFormat: @"%@", o]; + + if ((o = [contact objectForKey: @"title"])) + [s appendFormat: @"%@", o]; + + if ((o = [contact objectForKey: @"givenname"])) + [s appendFormat: @"%@", o]; + + if ((o = [contact objectForKey: @"sn"])) + [s appendFormat: @"%@", o]; + + if ([current_mail length] > 0) + [s appendFormat: @"%@", current_mail]; + + if ((o = [contact objectForKey: @"telephonenumber"])) + [s appendFormat: @"%@", o]; + + if ((o = [contact objectForKey: @"homephone"])) + [s appendFormat: @"%@", o]; + + if ((o = [contact objectForKey: @"mobile"])) + [s appendFormat: @"%@", o]; + + if ((o = [contact objectForKey: @"o"])) + [s appendFormat: @"%@", o]; + + [s appendString: @""]; + [s appendString: @""]; + } } } diff --git a/NEWS b/NEWS index 9dd1820c1..12680c84c 100644 --- a/NEWS +++ b/NEWS @@ -47,7 +47,8 @@ Bug fixes - optional attendes on events are now shown properly (Zentyal) - fixed the EAS maximum response size being per-folder, and not global - now set MeetingMessageType only for EAS 14.1 - - now correct handle external invitations using EAS + - now correctly handle external invitations using EAS + - now correctly handle multiple email addresses in the GAL over EAS (#3102) 2.2.17a (2015-03-15) --------------------