Skip to content

Commit f434863

Browse files
fixup! feat: automated appointment creation
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
1 parent e98decb commit f434863

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

lib/private/Calendar/Manager.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,27 @@ public function handleIMip(
316316
$this->logger->warning('iMip message could not be processed because no writable calendar was found');
317317
return false;
318318
}
319-
if (isset($options['absentCreateStatus']) && !empty($options['absentCreateStatus'])) {
319+
if (!empty($options['absentCreateStatus'])) {
320320
$status = strtoupper($options['absentCreateStatus']);
321+
322+
if (in_array($status, ['TENTATIVE', 'CONFIRMED', 'CANCELLED'], true) === false) {
323+
$this->logger->warning('iMip message could not be processed because an invalid status was provided for the event');
324+
return false;
325+
}
326+
321327
if (isset($vObject->VEVENT->STATUS)) {
322328
$vObject->VEVENT->STATUS->setValue($status);
323329
} else {
324330
$vObject->VEVENT->add('STATUS', $status);
325331
}
326332
}
327333

328-
$calendar->handleIMipMessage($userId, $vObject->serialize());
334+
try {
335+
$calendar->handleIMipMessage($userId, $vObject->serialize());
336+
} catch (CalendarException $e) {
337+
$this->logger->error('iMip message could not be processed because an error occurred', ['exception' => $e]);
338+
return false;
339+
}
329340

330341
return true;
331342
}

0 commit comments

Comments
 (0)