Merge pull request #145 from Zentyal/jvalles/appointment-updates
oc-calendar: Improve check for appointment updates
This commit is contained in:
commit
95f11f6d0d
|
@ -2106,20 +2106,14 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
|
||||||
//
|
//
|
||||||
if ([[newEvent attendees] count] || [[oldEvent attendees] count])
|
if ([[newEvent attendees] count] || [[oldEvent attendees] count])
|
||||||
{
|
{
|
||||||
NSString *uid;
|
BOOL userIsOrganizer;
|
||||||
|
|
||||||
// newEvent might be nil here, if we're deleting a RECURRENCE-ID with attendees
|
// newEvent might be nil here, if we're deleting a RECURRENCE-ID with attendees
|
||||||
// If that's the case, we use the oldEvent for now just to obtain the organizer
|
// If that's the case, we use the oldEvent to obtain the organizer
|
||||||
// and we'll swap it back to nil once we're done.
|
if (newEvent)
|
||||||
if (!newEvent)
|
userIsOrganizer = [newEvent userIsOrganizer: ownerUser];
|
||||||
newEvent = oldEvent;
|
else
|
||||||
|
userIsOrganizer = [oldEvent userIsOrganizer: ownerUser];
|
||||||
// We fetch the organizer's uid. Sometimes, the recurrence-id will
|
|
||||||
// have it, sometimes not. If it doesn't, we fetch it from the master event.
|
|
||||||
uid = [[newEvent organizer] uid];
|
|
||||||
|
|
||||||
if (!uid && !recurrenceId)
|
|
||||||
uid = [[[[[newEvent parent] events] objectAtIndex: 0] organizer] uid];
|
|
||||||
|
|
||||||
// With Thunderbird 10, if you create a recurring event with an exception
|
// With Thunderbird 10, if you create a recurring event with an exception
|
||||||
// occurence, and invite someone, the PUT will have the organizer in the
|
// occurence, and invite someone, the PUT will have the organizer in the
|
||||||
|
@ -2128,10 +2122,7 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
|
||||||
if (!recurrenceId && ![[[[[newEvent parent] events] objectAtIndex: 0] organizer] uid])
|
if (!recurrenceId && ![[[[[newEvent parent] events] objectAtIndex: 0] organizer] uid])
|
||||||
[[[[newEvent parent] events] objectAtIndex: 0] setOrganizer: [newEvent organizer]];
|
[[[[newEvent parent] events] objectAtIndex: 0] setOrganizer: [newEvent organizer]];
|
||||||
|
|
||||||
if (newEvent == oldEvent)
|
if (userIsOrganizer)
|
||||||
newEvent = nil;
|
|
||||||
|
|
||||||
if (uid && [uid caseInsensitiveCompare: owner] == NSOrderedSame)
|
|
||||||
{
|
{
|
||||||
// A RECCURENCE-ID was removed
|
// A RECCURENCE-ID was removed
|
||||||
if (!newEvent && oldEvent)
|
if (!newEvent && oldEvent)
|
||||||
|
|
Loading…
Reference in a new issue