Skip to content

Commit

Permalink
Merge pull request #49779 from nextcloud/backport/49503/stable29
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Dec 11, 2024
2 parents 274c98d + f186279 commit c1451b2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 27 deletions.
8 changes: 0 additions & 8 deletions apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,6 @@ public function beforeWriteContent($uri, INode $node, $data, $modified): void {
*/
public function schedule(Message $iTipMessage) {

// do not send imip messages if external system already did
/** @psalm-suppress UndefinedPropertyFetch */
if ($iTipMessage->message?->VEVENT?->{'X-NC-DISABLE-SCHEDULING'}?->getValue() === 'true') {
if (!$iTipMessage->scheduleStatus) {
$iTipMessage->scheduleStatus = '1.0;We got the message, but iMip messages are disabled for this event';
}
return;
}
// Not sending any emails if the system considers the update insignificant
if (!$iTipMessage->significantChange) {
if (!$iTipMessage->scheduleStatus) {
Expand Down
1 change: 1 addition & 0 deletions apps/dav/lib/CalDAV/Schedule/Plugin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (c) 2016, Roeland Jago Douma <roeland@famdouma.nl>
* @copyright Copyright (c) 2016, Joas Schilling <coding@schilljs.com>
Expand Down
19 changes: 0 additions & 19 deletions apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -783,23 +783,4 @@ public function testNoButtons(): void {
$this->plugin->schedule($message);
$this->assertEquals('1.1', $message->getScheduleStatus());
}

public function testImipDisabledForEvent(): void {
// construct iTip message with event and attendees
$calendar = new VCalendar();
$calendar->add('VEVENT', ['UID' => 'uid-1234']);
$event = $calendar->VEVENT;
$event->add('ORGANIZER', 'mailto:gandalf@wiz.ard');
$event->add('ATTENDEE', 'mailto:' . 'frodo@hobb.it', ['RSVP' => 'TRUE', 'CN' => 'Frodo']);
$event->add('X-NC-DISABLE-SCHEDULING', 'true');
$message = new Message();
$message->method = 'REQUEST';
$message->message = $calendar;
$message->sender = 'mailto:gandalf@wiz.ard';
$message->senderName = 'Mr. Wizard';
$message->recipient = 'mailto:' . 'frodo@hobb.it';

$this->plugin->schedule($message);
$this->assertEquals('1.0;We got the message, but iMip messages are disabled for this event', $message->scheduleStatus);
}
}
1 change: 1 addition & 0 deletions apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
*
Expand Down

0 comments on commit c1451b2

Please sign in to comment.