From 23386cab11086685967d5d0848e2e86b30032b86 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 27 Aug 2012 09:40:18 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 02a0c346903984d754efc6a1339191e14f2a9b9f Monotone-Revision: 81e5a2cbed9325efd0e582da75adabe4e79cff9f Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-08-27T09:40:18 --- ChangeLog | 6 ++++++ NEWS | 1 + .../Appointments/SOGoCalendarComponent.m | 18 +++++++++++++++++- SoObjects/Appointments/iCalPerson+SOGo.h | 3 ++- SoObjects/Appointments/iCalPerson+SOGo.m | 19 ++++++++++++++++--- 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index dfc804ab1..556db6045 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-08-27 Ludovic Marcotte + + * SoObjects/Appointments/iCalPerson+SOGo.m (mailAddress): + We now properly add double-quotes if we find a comma and + the person's name isn't already double-quoted. Fixes #1649 + 2012-08-24 Francis Lachapelle * UI/MailPartViewers/UIxMailPartHTMLViewer.m (_sanitizeContent): diff --git a/NEWS b/NEWS index 81fad2cc5..3e2cf1b54 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ Bug Fixes - fixed handling of exception dates with timezones in recurrent events - fixed validation of the interval in daily recurrent events with a day mask covering multiple days + - fixed name quoting when sending invitations 1.3.17 (2012-07-26) ------------------- diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 6c4c9ee97..e52aa75cc 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -1,9 +1,10 @@ /* SOGoCalendarComponent.m - this file is part of SOGo * - * Copyright (C) 2006-2011 Inverse inc. + * Copyright (C) 2006-2012 Inverse inc. * * Author: Wolfgang Sourdeau * Francis Lachapelle + * Ludovic Marcotte * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -951,6 +952,9 @@ } } +// +// +// - (void) sendResponseToOrganizer: (iCalRepeatableEntityObject *) newComponent from: (SOGoUser *) from { @@ -969,6 +973,9 @@ } } +// +// +// - (void) sendReceiptEmailForObject: (iCalRepeatableEntityObject *) object addedAttendees: (NSArray *) theAddedAttendees deletedAttendees: (NSArray *) theDeletedAttendees @@ -1069,6 +1076,9 @@ } +// +// +// - (iCalPerson *) findParticipantWithUID: (NSString *) uid { iCalEntityObject *component; @@ -1080,6 +1090,9 @@ return [component userAsAttendee: user]; } +// +// +// - (iCalPerson *) iCalPersonWithUID: (NSString *) uid { iCalPerson *person; @@ -1097,6 +1110,9 @@ return person; } +// +// +// - (NSArray *) getUIDsForICalPersons: (NSArray *) iCalPersons { iCalPerson *currentPerson; diff --git a/SoObjects/Appointments/iCalPerson+SOGo.h b/SoObjects/Appointments/iCalPerson+SOGo.h index 184e67542..3ce9d31a5 100644 --- a/SoObjects/Appointments/iCalPerson+SOGo.h +++ b/SoObjects/Appointments/iCalPerson+SOGo.h @@ -1,8 +1,9 @@ /* iCalPerson+SOGo.h - this file is part of SOGo * - * Copyright (C) 2007-2009 Inverse inc. + * Copyright (C) 2007-2012 Inverse inc. * * Author: Wolfgang Sourdeau + * Ludovic Marcotte * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/SoObjects/Appointments/iCalPerson+SOGo.m b/SoObjects/Appointments/iCalPerson+SOGo.m index e0d07e956..b7dc8e941 100644 --- a/SoObjects/Appointments/iCalPerson+SOGo.m +++ b/SoObjects/Appointments/iCalPerson+SOGo.m @@ -1,8 +1,9 @@ /* iCalPerson+SOGo.m - this file is part of SOGo * - * Copyright (C) 2007-2009 Inverse inc. + * Copyright (C) 2007-2012 Inverse inc. * * Author: Wolfgang Sourdeau + * Ludovic Marcotte * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,11 +34,23 @@ static SOGoUserManager *um = nil; - (NSString *) mailAddress { NSString *cn, *email, *mailAddress; + unsigned int len; cn = [self cnWithoutQuotes]; email = [self rfc822Email]; - if ([cn length]) - mailAddress = [NSString stringWithFormat:@"%@ <%@>", cn, email]; + len = [cn length]; + + if (len) + { + // We must check if we have to double-quote properly the person's name, + // in case for example we find a comma + if ([cn characterAtIndex: 0] != '"' && + [cn characterAtIndex: len-1] != '"' && + [cn rangeOfString: @","].length) + mailAddress = [NSString stringWithFormat:@"\"%@\" <%@>", cn, email]; + else + mailAddress = [NSString stringWithFormat:@"%@ <%@>", cn, email]; + } else mailAddress = email;