Skip to content

Commit

Permalink
feat: Add X-NC-Disable-Scheduling property to allow skipping scheduling
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Nov 11, 2024
1 parent 60b6840 commit 591a20d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function beforeWriteContent($uri, INode $node, $data, $modified): void {
public function schedule(Message $iTipMessage) {

// do not send imip messages if external system already did
if ($iTipMessage->message?->VEVENT?->{'X-NC-DISABLE-SCHEDULING'}?->getValue() === '1') {
if ($iTipMessage->message?->VEVENT?->{'X-NC-DISABLE-SCHEDULING'}?->getValue() === 'true') {

Check failure on line 100 in apps/dav/lib/CalDAV/Schedule/IMipPlugin.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

UndefinedPropertyFetch

apps/dav/lib/CalDAV/Schedule/IMipPlugin.php:100:7: UndefinedPropertyFetch: Instance property Sabre\VObject\Property::$X-NC-DISABLE-SCHEDULING is not defined (see https://psalm.dev/039)
if (!$iTipMessage->scheduleStatus) {
$iTipMessage->scheduleStatus = '1.0;We got the message, but iMip message are disabled for this event';
}
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ public function testImipDisabledForEvent(): void {
$event = $calendar->VEVENT;
$event->add('ORGANIZER', 'mailto:[email protected]');
$event->add('ATTENDEE', 'mailto:' . '[email protected]', ['RSVP' => 'TRUE', 'CN' => 'Frodo']);
$event->add('X-NC-DISABLE-SCHEDULING', '1');
$event->add('X-NC-DISABLE-SCHEDULING', 'true');
$message = new Message();
$message->method = 'REQUEST';
$message->message = $calendar;
Expand All @@ -907,6 +907,6 @@ public function testImipDisabledForEvent(): void {
$message->recipient = 'mailto:' . '[email protected]';

$this->plugin->schedule($message);
$this->assertEquals('1.0', $message->getScheduleStatus());
$this->assertEquals('1.0;We got the message, but iMip message are disabled for this event', $message->scheduleStatus);
}
}

0 comments on commit 591a20d

Please sign in to comment.