Calendar: Make sure account is set for alarm

This commit is contained in:
nathangray 2021-04-28 11:20:43 -06:00
parent 3f3748dc87
commit 56ac5d5be8

View File

@ -1479,8 +1479,11 @@ class calendar_boupdate extends calendar_bo
$expanded = $event;
$this->enum_groups($expanded);
foreach($event['alarm'] as $id => &$alarm)
{
if($alarm['time'])
{
$alarm['time'] = $this->date2ts($alarm['time'], true); // user to server-time
}
// remove alarms belonging to not longer existing or rejected participants
if ($alarm['owner'] && isset($expanded['participants']))
@ -1496,6 +1499,10 @@ class calendar_boupdate extends calendar_bo
//error_log(__LINE__.': '.__METHOD__."(".array2string($event).") deleting alarm=".array2string($alarm).", $status=".array2string($alarm));
}
}
else if (!$alarm['owner'])
{
$alarm['owner'] = $event['owner'];
}
}
}
// update all existing alarm times, in case alarm got moved and alarms are not include in $event