fix(eas): sync reminder for invitation (fixes #4911)
parent
3f94516e31
commit
9221811fdc
|
@ -44,6 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#import <NGCards/iCalCalendar.h>
|
#import <NGCards/iCalCalendar.h>
|
||||||
#import <NGCards/iCalEvent.h>
|
#import <NGCards/iCalEvent.h>
|
||||||
|
#import <NGCards/iCalAlarm.h>
|
||||||
#import <NGCards/iCalPerson.h>
|
#import <NGCards/iCalPerson.h>
|
||||||
|
|
||||||
#import <NGExtensions/NGBase64Coding.h>
|
#import <NGExtensions/NGBase64Coding.h>
|
||||||
|
@ -90,6 +91,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#import <Appointments/SOGoAppointmentFolder.h>
|
#import <Appointments/SOGoAppointmentFolder.h>
|
||||||
#import <Appointments/SOGoAppointmentFolders.h>
|
#import <Appointments/SOGoAppointmentFolders.h>
|
||||||
#import <Appointments/SOGoAppointmentObject.h>
|
#import <Appointments/SOGoAppointmentObject.h>
|
||||||
|
#import <Appointments/iCalEntityObject+SOGo.h>
|
||||||
|
|
||||||
#import <Contacts/SOGoContactGCSFolder.h>
|
#import <Contacts/SOGoContactGCSFolder.h>
|
||||||
#import <Contacts/SOGoContactFolders.h>
|
#import <Contacts/SOGoContactFolders.h>
|
||||||
|
@ -1862,6 +1864,7 @@ void handle_eas_terminate(int signum)
|
||||||
{
|
{
|
||||||
NSString *realCollectionId, *requestId, *easRequestId, *participationStatus, *calendarId;
|
NSString *realCollectionId, *requestId, *easRequestId, *participationStatus, *calendarId;
|
||||||
SOGoAppointmentObject *appointmentObject;
|
SOGoAppointmentObject *appointmentObject;
|
||||||
|
iCalAlarm *alarm = nil;
|
||||||
SOGoMailObject *mailObject;
|
SOGoMailObject *mailObject;
|
||||||
NSMutableDictionary *uidCache, *folderMetadata;
|
NSMutableDictionary *uidCache, *folderMetadata;
|
||||||
NSMutableString *s, *nameInCache;
|
NSMutableString *s, *nameInCache;
|
||||||
|
@ -1959,6 +1962,9 @@ void handle_eas_terminate(int signum)
|
||||||
event = [[calendar events] lastObject];
|
event = [[calendar events] lastObject];
|
||||||
calendarId = [event uid];
|
calendarId = [event uid];
|
||||||
|
|
||||||
|
// We take the organizers's alarm to start with
|
||||||
|
alarm = [event firstSupportedAlarm];
|
||||||
|
|
||||||
// Fetch the SOGoAppointmentObject
|
// Fetch the SOGoAppointmentObject
|
||||||
collection = [[context activeUser] personalCalendarFolderInContext: context];
|
collection = [[context activeUser] personalCalendarFolderInContext: context];
|
||||||
nameInCache = [NSString stringWithFormat: @"vevent/%@", [collection nameInContainer]];
|
nameInCache = [NSString stringWithFormat: @"vevent/%@", [collection nameInContainer]];
|
||||||
|
@ -1979,7 +1985,7 @@ void handle_eas_terminate(int signum)
|
||||||
{
|
{
|
||||||
appointmentObject = [[SOGoAppointmentObject alloc] initWithName: [NSString stringWithFormat: @"%@.ics", [event uid]]
|
appointmentObject = [[SOGoAppointmentObject alloc] initWithName: [NSString stringWithFormat: @"%@.ics", [event uid]]
|
||||||
inContainer: collection];
|
inContainer: collection];
|
||||||
[appointmentObject saveComponent: event force: YES];
|
[appointmentObject saveCalendar: [event parent]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uidCache && [calendarId length] > 64)
|
if (uidCache && [calendarId length] > 64)
|
||||||
|
@ -2019,7 +2025,7 @@ void handle_eas_terminate(int signum)
|
||||||
|
|
||||||
[appointmentObject changeParticipationStatus: participationStatus
|
[appointmentObject changeParticipationStatus: participationStatus
|
||||||
withDelegate: nil
|
withDelegate: nil
|
||||||
alarm: nil];
|
alarm: alarm];
|
||||||
|
|
||||||
[s appendString: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"];
|
[s appendString: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"];
|
||||||
[s appendString: @"<!DOCTYPE ActiveSync PUBLIC \"-//MICROSOFT//DTD ActiveSync//EN\" \"http://www.microsoft.com/\">"];
|
[s appendString: @"<!DOCTYPE ActiveSync PUBLIC \"-//MICROSOFT//DTD ActiveSync//EN\" \"http://www.microsoft.com/\">"];
|
||||||
|
|
|
@ -908,8 +908,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
component: (id) component
|
component: (id) component
|
||||||
{
|
{
|
||||||
NSString *status;
|
NSString *status;
|
||||||
|
iCalAlarm *alarm;
|
||||||
|
iCalPerson *attendee;
|
||||||
id o;
|
id o;
|
||||||
|
|
||||||
|
|
||||||
|
attendee = [self userAsAttendee: [context activeUser]];
|
||||||
|
status = [attendee partStat];
|
||||||
|
alarm = nil;
|
||||||
|
|
||||||
// See: https://msdn.microsoft.com/en-us/library/ee202290(v=exchg.80).aspx
|
// See: https://msdn.microsoft.com/en-us/library/ee202290(v=exchg.80).aspx
|
||||||
//
|
//
|
||||||
// 0 == Free
|
// 0 == Free
|
||||||
|
@ -928,11 +935,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
else
|
else
|
||||||
status = @"TENTATIVE";
|
status = @"TENTATIVE";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((o = [theValues objectForKey: @"Reminder"]) && [o length])
|
||||||
|
{
|
||||||
|
if ([self hasAlarms])
|
||||||
|
alarm = [[self firstSupportedAlarm] mutableCopy];
|
||||||
|
else
|
||||||
|
alarm = [[iCalAlarm alloc] init];
|
||||||
|
|
||||||
|
[alarm takeActiveSyncValues: theValues inContext: context];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// There's no delegate in EAS
|
// There's no delegate in EAS
|
||||||
[(SOGoAppointmentObject *) component changeParticipationStatus: status
|
[(SOGoAppointmentObject *) component changeParticipationStatus: status
|
||||||
withDelegate: nil
|
withDelegate: nil
|
||||||
alarm: nil];
|
alarm: alarm];
|
||||||
}
|
RELEASE(alarm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue