diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php index f007304c..9d68fc4c 100644 --- a/lib/ITip/Broker.php +++ b/lib/ITip/Broker.php @@ -510,10 +510,11 @@ protected function parseEventForOrganizer(VCalendar $calendar, array $eventInfo, $icalMsg->add(clone $timezone); } - if (!$attendee['newInstances']) { - // If there are no instances the attendee is a part of, it - // means the attendee was removed and we need to send him a - // CANCEL. + if (!$attendee['newInstances'] || 'CANCELLED' === $eventInfo['status']) { + // If there are no instances the attendee is a part of, it means + // the attendee was removed and we need to send them a CANCEL message. + // Also If the meeting STATUS property was changed to CANCELLED + // we need to send the attendee a CANCEL message. $message->method = 'CANCEL'; $icalMsg->METHOD = $message->method; diff --git a/tests/VObject/ITip/BrokerUpdateEventTest.php b/tests/VObject/ITip/BrokerUpdateEventTest.php index e93f8965..24892f46 100644 --- a/tests/VObject/ITip/BrokerUpdateEventTest.php +++ b/tests/VObject/ITip/BrokerUpdateEventTest.php @@ -814,4 +814,66 @@ public function testInviteChangeExdateOrder() $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org'); } + + public function testInviteStatusCancelled(): void + { + $oldMessage = << 'foobar', + 'method' => 'CANCEL', + 'component' => 'VEVENT', + 'message' => <<parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org'); + } }