Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(caldav): Create personal event for out-of-office messages #41340

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Nov 8, 2023

Summary

Create and maintain an event in a user's personal calendar when they configure an out of office message.

TODO

  • Create event when OOO is set
  • Update event when OOO is updated
  • Delete event when OOO is deleted before it ends
  • Bug when OOO event is deleted by user and causes a trash bin conflict when deleted again by the system

Checklist

@ChristophWurst ChristophWurst added the 2. developing Work in progress label Nov 8, 2023
@ChristophWurst ChristophWurst self-assigned this Nov 8, 2023
This was referenced Nov 8, 2023
@ChristophWurst ChristophWurst added pending documentation This pull request needs an associated documentation update 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 13, 2023
@ChristophWurst ChristophWurst marked this pull request as ready for review November 13, 2023 18:01
@ChristophWurst ChristophWurst added this to the Nextcloud 28 milestone Nov 13, 2023
apps/dav/lib/Listener/OutOfOfficeListener.php Show resolved Hide resolved
apps/dav/lib/Listener/OutOfOfficeListener.php Show resolved Hide resolved
apps/dav/lib/Listener/OutOfOfficeListener.php Outdated Show resolved Hide resolved
apps/dav/lib/Listener/OutOfOfficeListener.php Outdated Show resolved Hide resolved
apps/dav/lib/Listener/OutOfOfficeListener.php Outdated Show resolved Hide resolved
@miaulalala
Copy link
Contributor

You can leave as is except for the PRODID.

$vCalendar->add($vtimezone);

/** @psalm-suppress UndefinedMethod */
$vEvent->DTSTART->setDateTime($start->setTimezone($calendarTimeZone)->setTime(0, 0));

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method setDateTime on possibly null value
/** @psalm-suppress UndefinedMethod */
$vEvent->DTSTART->setDateTime($start->setTimezone($calendarTimeZone)->setTime(0, 0));
/** @psalm-suppress UndefinedMethod */
$vEvent->DTEND->setDateTime($end->setTimezone($calendarTimeZone)->setTime(0, 0));

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method setDateTime on possibly null value
@@ -70,8 +71,10 @@
if ($user->getUID() !== $this->getUserId()) {
throw new InvalidArgumentException("The user doesn't match the user id of this absence! Expected " . $this->getUserId() . ", got " . $user->getUID());
}
if ($this->getId() === null) {

Check notice

Code scanning / Psalm

DocblockTypeContradiction Note

int does not contain null
@ChristophWurst ChristophWurst merged commit 8b5d85a into master Nov 14, 2023
48 of 50 checks passed
@ChristophWurst ChristophWurst deleted the feat/caldav/ooo-event branch November 14, 2023 14:53
@tcitworld
Copy link
Member

@ChristophWurst #42142 made me notice I had never submitted my review. Added two comments directly on commit itself since I can't post it anymore.
5b7a547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement feature: caldav Related to CalDAV internals feature: dav integration pending documentation This pull request needs an associated documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create personal event for out of office messages
4 participants