Skip to content

Commit d2e5b95

Browse files
fix: disable both iTip and iMip messages
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com> [skip ci]
1 parent c69df62 commit d2e5b95

File tree

4 files changed

+2
-27
lines changed

4 files changed

+2
-27
lines changed

apps/dav/lib/CalDAV/Schedule/IMipPlugin.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,6 @@ public function beforeWriteContent($uri, INode $node, $data, $modified): void {
133133
*/
134134
public function schedule(Message $iTipMessage) {
135135

136-
// do not send imip messages if external system already did
137-
/** @psalm-suppress UndefinedPropertyFetch */
138-
if ($iTipMessage->message?->VEVENT?->{'X-NC-DISABLE-SCHEDULING'}?->getValue() === 'true') {
139-
if (!$iTipMessage->scheduleStatus) {
140-
$iTipMessage->scheduleStatus = '1.0;We got the message, but iMip messages are disabled for this event';
141-
}
142-
return;
143-
}
144136
// Not sending any emails if the system considers the update insignificant
145137
if (!$iTipMessage->significantChange) {
146138
if (!$iTipMessage->scheduleStatus) {

apps/dav/lib/CalDAV/Schedule/Plugin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright Copyright (c) 2016, Roeland Jago Douma <roeland@famdouma.nl>
45
* @copyright Copyright (c) 2016, Joas Schilling <coding@schilljs.com>

apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -783,23 +783,4 @@ public function testNoButtons(): void {
783783
$this->plugin->schedule($message);
784784
$this->assertEquals('1.1', $message->getScheduleStatus());
785785
}
786-
787-
public function testImipDisabledForEvent(): void {
788-
// construct iTip message with event and attendees
789-
$calendar = new VCalendar();
790-
$calendar->add('VEVENT', ['UID' => 'uid-1234']);
791-
$event = $calendar->VEVENT;
792-
$event->add('ORGANIZER', 'mailto:gandalf@wiz.ard');
793-
$event->add('ATTENDEE', 'mailto:' . 'frodo@hobb.it', ['RSVP' => 'TRUE', 'CN' => 'Frodo']);
794-
$event->add('X-NC-DISABLE-SCHEDULING', 'true');
795-
$message = new Message();
796-
$message->method = 'REQUEST';
797-
$message->message = $calendar;
798-
$message->sender = 'mailto:gandalf@wiz.ard';
799-
$message->senderName = 'Mr. Wizard';
800-
$message->recipient = 'mailto:' . 'frodo@hobb.it';
801-
802-
$this->plugin->schedule($message);
803-
$this->assertEquals('1.0;We got the message, but iMip messages are disabled for this event', $message->scheduleStatus);
804-
}
805786
}

apps/dav/tests/unit/CalDAV/Schedule/PluginTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
45
*

0 commit comments

Comments
 (0)