if iCal file contains no participant information, always add current user as participant

fixes importing events w/o participants won't add current user to existing event, imported for another user before
This commit is contained in:
ralf 2024-06-06 14:13:12 +02:00
parent 5a48b4ac57
commit 02d0f8327b

View File

@ -1303,8 +1303,11 @@ class calendar_ical extends calendar_boupdate
{
$event['id'] = $event_info['stored_event']['id']; // CalDAV does only provide UIDs
}
if (is_array($event['participants']))
// if file contains no participants add current user
if (empty($event['participants']))
{
$event['participants'] = [$user => calendar_so::combine_status('A'));
}
// if the client does not return a status, we restore the original one
foreach ($event['participants'] as $uid => $status)
{
@ -1339,7 +1342,6 @@ class calendar_ical extends calendar_boupdate
}
}
}
}
// unset old X-* attributes stored in custom-fields with exception of our videoconference and notify-externals
foreach ($event_info['stored_event'] as $key => $value)
{