Skip to content

Commit

Permalink
fix(calendar): restore [SOGoAppointmentObject resourceHasAutoAccepted]
Browse files Browse the repository at this point in the history
This method is used for ActiveSync support.

Fixes #4923
  • Loading branch information
cgx committed Jan 6, 2020
1 parent 5b089bb commit 91ca8b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion SoObjects/Appointments/SOGoAppointmentObject.h
@@ -1,5 +1,5 @@
/*
Copyright (C) 2007-2019 Inverse inc.
Copyright (C) 2007-2020 Inverse inc.
This file is part of SOGo
Expand Down Expand Up @@ -37,6 +37,7 @@

@interface SOGoAppointmentObject : SOGoCalendarComponent
{
BOOL _resourceHasAutoAccepted;
}

- (NSException *) changeParticipationStatus: (NSString *) status
Expand All @@ -61,6 +62,7 @@
- (NSException *) updateContentWithCalendar: (iCalCalendar *) calendar
fromRequest: (WORequest *) rq;

- (BOOL) resourceHasAutoAccepted;
@end

#endif /* __Appointments_SOGoAppointmentObject_H__ */
11 changes: 6 additions & 5 deletions SoObjects/Appointments/SOGoAppointmentObject.m
@@ -1,5 +1,5 @@
/*
Copyright (C) 2007-2019 Inverse inc.
Copyright (C) 2007-2020 Inverse inc.
This file is part of SOGo
Expand Down Expand Up @@ -627,6 +627,8 @@ - (NSException *) _handleAttendeesConflicts: (NSArray *) theAttendees
NSString *currentUID;
SOGoUser *user, *currentUser;

_resourceHasAutoAccepted = NO;

// Build a list of the attendees uids
attendees = [NSMutableArray arrayWithCapacity: [theAttendees count]];
enumerator = [theAttendees objectEnumerator];
Expand Down Expand Up @@ -761,10 +763,8 @@ - (NSException *) _handleAttendeesConflicts: (NSArray *) theAttendees

if ([fbInfo count])
{
BOOL resourceHasAutoAccepted;
SOGoDateFormatter *formatter;

resourceHasAutoAccepted = NO;
formatter = [[context activeUser] dateFormatterInContext: context];

if ([user isResource])
Expand All @@ -781,7 +781,7 @@ - (NSException *) _handleAttendeesConflicts: (NSArray *) theAttendees
{
[[currentAttendee attributes] removeObjectForKey: @"RSVP"];
[currentAttendee setParticipationStatus: iCalPersonPartStatAccepted];
resourceHasAutoAccepted = YES;
_resourceHasAutoAccepted = YES;
}
}
else
Expand Down Expand Up @@ -814,7 +814,7 @@ - (NSException *) _handleAttendeesConflicts: (NSArray *) theAttendees
// We are dealing with a normal attendee. Lets check if we have conflicts, unless
// we are being asked to force the save anyway
//
if (!forceSave && !resourceHasAutoAccepted)
if (!forceSave && !_resourceHasAutoAccepted)
{
NSMutableDictionary *info;
NSMutableArray *conflicts;
Expand Down Expand Up @@ -868,6 +868,7 @@ - (NSException *) _handleAttendeesConflicts: (NSArray *) theAttendees
// set the resource as one!
[[currentAttendee attributes] removeObjectForKey: @"RSVP"];
[currentAttendee setParticipationStatus: iCalPersonPartStatAccepted];
_resourceHasAutoAccepted = YES;
}
}

Expand Down

0 comments on commit 91ca8b8

Please sign in to comment.