Single isntances and some updates shit.
This commit is contained in:
@@ -1811,14 +1811,8 @@ public class OutlookSynchronizer : WinoSynchronizer<RequestInformation, Message,
|
||||
|
||||
var messageIteratorAsync = PageIterator<Event, Microsoft.Graph.Me.Calendars.Item.CalendarView.Delta.DeltaGetResponse>.CreatePageIterator(_graphClient, eventsDeltaResponse, (item) =>
|
||||
{
|
||||
// Skip occurrence events during initial sync - only sync master recurring events and single instances
|
||||
// Occurrences are individual instances of recurring events and will be generated from the seriesMaster
|
||||
if (item.Type == Microsoft.Graph.Models.EventType.Occurrence)
|
||||
{
|
||||
_logger.Debug("Skipping occurrence event {EventId} during initial sync", item.Id);
|
||||
return true; // Skip this occurrence
|
||||
}
|
||||
|
||||
// Include all event types: SingleInstance, SeriesMaster, Occurrence, and Exception
|
||||
// CalendarView already expands recurring events into individual occurrences
|
||||
events.Add(item);
|
||||
|
||||
return true;
|
||||
@@ -1835,10 +1829,6 @@ public class OutlookSynchronizer : WinoSynchronizer<RequestInformation, Message,
|
||||
|
||||
foreach (var item in events)
|
||||
{
|
||||
if (item.Id == "f275fdd0-8622-4e14-8f5d-b73d7f68018f")
|
||||
{
|
||||
|
||||
}
|
||||
// Declined events are returned as Deleted from the API.
|
||||
// There is no way to distinguish unfortunately atm.
|
||||
|
||||
@@ -2217,6 +2207,28 @@ public class OutlookSynchronizer : WinoSynchronizer<RequestInformation, Message,
|
||||
return [new HttpRequestBundle<RequestInformation>(updateRequest, request)];
|
||||
}
|
||||
|
||||
public override List<IRequestBundle<RequestInformation>> DeleteCalendarEvent(DeleteCalendarEventRequest request)
|
||||
{
|
||||
var calendarItem = request.Item;
|
||||
|
||||
// Get the calendar for this event
|
||||
var calendar = calendarItem.AssignedCalendar;
|
||||
if (calendar == null)
|
||||
{
|
||||
throw new InvalidOperationException("Calendar item must have an assigned calendar");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(calendarItem.RemoteEventId))
|
||||
{
|
||||
throw new InvalidOperationException("Cannot delete event without remote event ID");
|
||||
}
|
||||
|
||||
// Delete the event using Graph API
|
||||
var deleteRequest = _graphClient.Me.Calendars[calendar.RemoteCalendarId].Events[calendarItem.RemoteEventId].ToDeleteRequestInformation();
|
||||
|
||||
return [new HttpRequestBundle<RequestInformation>(deleteRequest, request)];
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public override async Task KillSynchronizerAsync()
|
||||
|
||||
Reference in New Issue
Block a user