Skip to content

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

Merged
ChristophWurst merged 1 commit into
masterfrom
feat/caldav/ooo-event
Nov 14, 2023
Merged

feat(caldav): Create personal event for out-of-office messages#41340
ChristophWurst merged 1 commit into
masterfrom
feat/caldav/ooo-event

Conversation

@ChristophWurst

@ChristophWurstChristophWurst commented Nov 8, 2023

Copy link
Copy Markdown
Member

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

@ChristophWurstChristophWurst added the 2. developing Work in progress label Nov 8, 2023
@ChristophWurstChristophWurst self-assigned this Nov 8, 2023
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
This was referenced Nov 8, 2023
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Outdated
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
@ChristophWurstChristophWurst 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
Comment threadapps/dav/lib/Db/Absence.php Fixed
Comment threadlib/public/AppFramework/Db/Entity.php Fixed
@ChristophWurstChristophWurst added this to the Nextcloud 28 milestone Nov 13, 2023
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
fclose($stream);
}
}
} else if ($event instanceof OutOfOfficeClearedEvent) {

Check notice

Code scanning / Psalm

RedundantConditionGivenDocblockType

Docblock-defined type OCP\User\Events\OutOfOfficeClearedEvent for $event is always OCP\User\Events\OutOfOfficeClearedEvent
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Outdated
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Outdated
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Outdated
@miaulalala

Copy link
Copy Markdown
Contributor

You can leave as is except for the PRODID.

Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php Fixed
Comment threadapps/dav/lib/Listener/OutOfOfficeListener.php
$vCalendar->add($vtimezone);

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

Check notice

Code scanning / Psalm

PossiblyNullReference

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

Cannot call method setDateTime on possibly null value
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
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

int does not contain null
@ChristophWurst
ChristophWurst merged commit 8b5d85a into masterNov 14, 2023
@ChristophWurst
ChristophWurst deleted the feat/caldav/ooo-event branch November 14, 2023 14:53
@tcitworld

Copy link
Copy Markdown
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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsenhancementfeature: caldavRelated to CalDAV internalsfeature: davintegrationpending documentationThis 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

5 participants

@ChristophWurst@miaulalala@tcitworld@AndyScherzinger@github-advanced-security