diff options
author | SebastianKrupinski <krupinskis05@gmail.com> | 2025-03-14 23:19:16 -0400 |
---|---|---|
committer | SebastianKrupinski <krupinskis05@gmail.com> | 2025-03-28 03:48:48 -0400 |
commit | 2de6d6b908c27765cfe20dc91f2076804f0859bd (patch) | |
tree | 55fa153019f53bca1399f23e3efd3a5230d9ff88 /lib/private | |
parent | d40cebb1c70f864af78517d747c723d3b5ec5ef9 (diff) | |
download | nextcloud-server-fix/noid-add-status-and-set-attendee-status.tar.gz nextcloud-server-fix/noid-add-status-and-set-attendee-status.zip |
fix: add event status and participant statusfix/noid-add-status-and-set-attendee-status
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Calendar/CalendarEventBuilder.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/Calendar/CalendarEventBuilder.php b/lib/private/Calendar/CalendarEventBuilder.php index 9198d383ef9..1aa11c2436d 100644 --- a/lib/private/Calendar/CalendarEventBuilder.php +++ b/lib/private/Calendar/CalendarEventBuilder.php @@ -12,6 +12,7 @@ namespace OC\Calendar; use DateTimeInterface; use InvalidArgumentException; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Calendar\CalendarEventStatus; use OCP\Calendar\ICalendarEventBuilder; use OCP\Calendar\ICreateFromString; use Sabre\VObject\Component\VCalendar; @@ -23,6 +24,7 @@ class CalendarEventBuilder implements ICalendarEventBuilder { private ?string $summary = null; private ?string $description = null; private ?string $location = null; + private ?CalendarEventStatus $status = null; private ?array $organizer = null; private array $attendees = []; @@ -57,6 +59,11 @@ class CalendarEventBuilder implements ICalendarEventBuilder { return $this; } + public function setStatus(CalendarEventStatus $status): static { + $this->status = $status; + return $this; + } + public function setOrganizer(string $email, ?string $commonName = null): ICalendarEventBuilder { $this->organizer = [$email, $commonName]; return $this; @@ -91,6 +98,7 @@ class CalendarEventBuilder implements ICalendarEventBuilder { 'SUMMARY' => $this->summary, 'DTSTART' => $this->startDate, 'DTEND' => $this->endDate, + 'STATUS' => $this->status->value, ]; if ($this->description !== null) { $props['DESCRIPTION'] = $this->description; @@ -126,6 +134,13 @@ class CalendarEventBuilder implements ICalendarEventBuilder { $params = []; if ($cn !== null) { $params['CN'] = $cn; + if ($name === 'ORGANIZER') { + $params['ROLE'] = 'CHAIR'; + $params['PARTSTAT'] = 'ACCEPTED'; + } else { + $params['ROLE'] = 'REQ-PARTICIPANT'; + $params['PARTSTAT'] = 'NEEDS-ACTION'; + } } $vevent->add($name, $email, $params); } |