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(ocp): add calendar api to retrieve availability of attendees #50100

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Jan 8, 2025

Summary

Add a public API to check if a list of attendees are available in a given time slot. Note that for now, the email addresses of the given attendees have to belong to users on the same instance.

Usage example

$start = new DateTimeImmutable('now');
$result = $this->calendarManager->checkAvailability(
	$start,
	$start->add(new \DateInterval('PT2H')),
	$organizer, // IUser(uid=admin, [email protected])
	['[email protected]', '[email protected]']
)

// Result (see \OCP\Calendar\IAvailabilityResult):
// $result[0]->getAttendeeEmail() === '[email protected]'
// $result[0]->isAvailable() === false
// $result[1]->getAttendeeEmail() === '[email protected]'
// $result[1]->isAvailable() === true
// $result[2]->getAttendeeEmail() === '[email protected]'
// $result[2]->isAvailable() === false

Checklist

@st3iny st3iny added enhancement 2. developing Work in progress integration feature: caldav Related to CalDAV internals labels Jan 8, 2025
@st3iny st3iny self-assigned this Jan 8, 2025
@st3iny st3iny marked this pull request as ready for review January 9, 2025 09:42
@st3iny st3iny added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 9, 2025
@st3iny st3iny added this to the Nextcloud 31 milestone Jan 9, 2025
@blizzz blizzz mentioned this pull request Jan 9, 2025
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it can do the job, but didn't test

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good otherwise :)

apps/dav/lib/ServerFactory.php Outdated Show resolved Hide resolved
lib/public/Calendar/IManager.php Outdated Show resolved Hide resolved
lib/private/Calendar/Manager.php Outdated Show resolved Hide resolved
@st3iny st3iny requested a review from ChristophWurst January 11, 2025 13:34
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 integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants