From e1797c9365a172c8910995d8d9bd240265fdae37 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 10 Nov 2009 16:18:57 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: ac03f0324d16940145f9feb2cf56e61ed3ee5ef6 Monotone-Revision: 9aa24eb1e4a4107aaa9cf4e74e6f8c5b0477350a Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-11-10T16:18:57 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 10 ++++++- UI/Scheduler/UIxComponentEditor.m | 49 ++++++++++++++++--------------- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e6134bd0..497103183 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-10 Francis Lachapelle + + * UI/Scheduler/UIxComponentEditor.m (-_handleAttendeesEdition): + avoid scanning JSON when there's no attendee. + 2009-11-07 Ludovic Marcotte * SoObjects/SOGo/SOGoCache.m - if we get a JSON @@ -18,6 +23,9 @@ 2009-11-05 Francis Lachapelle + * Scripts/updates.php: Minor changes to support when PHP short_open_tag + parameter is set to Off. + * UI/WebServerResources/ContactsUI.js (getMenus): activated the list creation option of the addresbooks contextual menu. @@ -3712,7 +3720,7 @@ * UI/MailerUI/UIxMailAccountActions.m ([WOResponse -listMailboxesAction]): also returns the inbox quota, wrapped in a new dictionary with keys "mailboxes" and "quotas". Uses the new user - default "SOGoSoftQuota" to force a quota and ignore the one + default "SOGoSoftQuotaRatio" to force a quota and ignore the one returned by the IMAP server. 2008-09-17 Wolfgang Sourdeau diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 8970c29b9..147a5b3d2 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -1494,35 +1494,38 @@ RANGE(2); request = [context request]; json = [request formValueForKey: @"attendees"]; - attendees = [NSArray array]; - jsonScanner = [NSScanner scannerWithString: json]; - if ([jsonScanner scanJSONObject: &attendeesData]) + if ([json length]) { - newAttendees = [NSMutableArray new]; - attendees = [attendeesData allValues]; - max = [attendees count]; - for (count = 0; count < max; count++) + attendees = [NSArray array]; + jsonScanner = [NSScanner scannerWithString: json]; + if ([jsonScanner scanJSONObject: &attendeesData]) { - currentData = [attendees objectAtIndex: count]; - currentEmail = [currentData objectForKey: @"email"]; - currentAttendee = [component findParticipantWithEmail: currentEmail]; - if (!currentAttendee) + newAttendees = [NSMutableArray new]; + attendees = [attendeesData allValues]; + max = [attendees count]; + for (count = 0; count < max; count++) { - currentAttendee = [iCalPerson elementWithTag: @"attendee"]; - [currentAttendee setCn: [currentData objectForKey: @"name"]]; - [currentAttendee setEmail: currentEmail]; - [currentAttendee setRole: @"REQ-PARTICIPANT"]; - [currentAttendee setRsvp: @"TRUE"]; - [currentAttendee - setParticipationStatus: iCalPersonPartStatNeedsAction]; + currentData = [attendees objectAtIndex: count]; + currentEmail = [currentData objectForKey: @"email"]; + currentAttendee = [component findParticipantWithEmail: currentEmail]; + if (!currentAttendee) + { + currentAttendee = [iCalPerson elementWithTag: @"attendee"]; + [currentAttendee setCn: [currentData objectForKey: @"name"]]; + [currentAttendee setEmail: currentEmail]; + [currentAttendee setRole: @"REQ-PARTICIPANT"]; + [currentAttendee setRsvp: @"TRUE"]; + [currentAttendee + setParticipationStatus: iCalPersonPartStatNeedsAction]; + } + [newAttendees addObject: currentAttendee]; } - [newAttendees addObject: currentAttendee]; + [component setAttendees: newAttendees]; + [newAttendees release]; } - [component setAttendees: newAttendees]; - [newAttendees release]; + else + NSLog(@"Error scanning following JSON:\n%@", json); } - else - NSLog(@"Error scanning following JSON:\n%@", json); } - (void) _handleOrganizer