From e95d7fa39e0b4176482ef66c9a518042f89f8e19 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 1 Dec 2008 19:20:25 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: a81f3635524596f99835829a1a4835f3a7f58c1b Monotone-Revision: 1306bcb572d16a67199e32e625572c3430d39626 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2008-12-01T19:20:25 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ SoObjects/Appointments/SOGoAppointmentObject.m | 6 ++++-- SoObjects/Appointments/SOGoCalendarComponent.m | 17 ++++++++++++++++- UI/WebServerResources/UIxTaskEditor.css | 5 +---- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d24b08c50..425cb4734 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-12-01 Ludovic Marcotte + + * We now try to match the c_name and c_uid + when creating events from the Web interface. + This can avoid creating duplicate events + with IMIP when calendar refreshes haven't occured + before the accept/decline/tentative actions. + 2008-11-29 Ludovic Marcotte * Updated german translation - patch from diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 478e90b10..8b8ee2e7d 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -368,6 +368,10 @@ [[newEvent parent] setMethod: @""]; ownerUser = [SOGoUser userWithLogin: owner roles: nil]; + + // We first save the event. It is important to this initially + // as the event's UID might get modified in SOGoCalendarComponent: -saveComponent: + [super saveComponent: newEvent]; if ([newEvent userIsOrganizer: ownerUser]) { @@ -395,8 +399,6 @@ [self _handleUpdatedEvent: newEvent fromOldEvent: oldEvent]; } } - - [super saveComponent: newEvent]; } // diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index edaff2dd1..0b06535f0 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -409,11 +409,26 @@ _occurenceHasID (iCalRepeatableEntityObject *occurence, NSString *recID) - (void) saveComponent: (iCalRepeatableEntityObject *) newObject { - NSString *newiCalString; + NSString *newiCalString, *newUid; if (!isNew && [newObject isRecurrent]) [self _updateRecurrenceIDs]; + + // As much as we can, we try to use c_name == c_uid in order + // to avoid tricky scenarios with some CalDAV clients. For example, + // if Alice invites Bob (both use SOGo) and Bob accepts the invitation + // using Lightning before having refreshed his calendar, he'll end up + // with a duplicate of the event in his database tables. + if (isNew) + { + newUid = nameInContainer; + + if ([newUid hasSuffix: @".ics"]) + newUid = [newUid substringToIndex: [newUid length]-4]; + [newObject setUid: newUid]; + } + newiCalString = [[newObject parent] versitString]; [self saveContentString: newiCalString]; diff --git a/UI/WebServerResources/UIxTaskEditor.css b/UI/WebServerResources/UIxTaskEditor.css index d858ba810..a3d92e661 100644 --- a/UI/WebServerResources/UIxTaskEditor.css +++ b/UI/WebServerResources/UIxTaskEditor.css @@ -94,10 +94,7 @@ SPAN#allDay > INPUT { position: static; } SPAN.content > INPUT -{ position: absolute; - top: 0px; - left: 0px; - right: 0px; } +{ width: 390px; } INPUT#startDateCB, INPUT#dueDateCB,