UPSTREAM BASELINE: nextcloud/spreed v22.0.12 (без изменений)
Type checking / changes (push) Has been cancelled
Type checking / test (push) Has been cancelled
Type checking / typescript-summary (push) Has been cancelled
Node tests / changes (push) Has been cancelled
Node tests / test (push) Has been cancelled
Node tests / test-summary (push) Has been cancelled

Источник: https://github.com/nextcloud/spreed/archive/refs/tags/v22.0.12.tar.gz
С этого коммита ветка официального Nextcloud Talk отрезана (решение владельца 2026-07-06).
Все дальнейшие изменения — только наши; версии релизов: 22.0.12-f7.N.
This commit is contained in:
2026-07-06 14:07:50 +00:00
commit 01acfa3b40
1716 changed files with 613013 additions and 0 deletions
@@ -0,0 +1,77 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Talk\Controller;
use OCA\Talk\Exceptions\InvalidRoomException;
use OCA\Talk\Exceptions\ParticipantNotFoundException;
use OCA\Talk\Middleware\Attribute\RequireParticipant;
use OCA\Talk\ResponseDefinitions;
use OCA\Talk\Service\CalendarIntegrationService;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
use OCP\IUserSession;
use Psr\Log\LoggerInterface;
/**
* @psalm-import-type TalkDashboardEvent from ResponseDefinitions
*/
class CalendarIntegrationController extends AEnvironmentAwareOCSController {
public function __construct(
string $appName,
IRequest $request,
protected IUserSession $userSession,
protected LoggerInterface $logger,
protected CalendarIntegrationService $service,
) {
parent::__construct($appName, $request);
}
/**
* Get up to 10 rooms that have events in the next 7 days
* sorted by their start timestamp ascending
*
* Required capability: `dashboard-event-rooms`
*
* @return DataResponse<Http::STATUS_OK, list<TalkDashboardEvent>, array{}>
*
* 200: A list of dashboard entries or an empty array
*/
#[NoAdminRequired]
public function getDashboardEvents(): DataResponse {
$userId = $this->userSession->getUser()?->getUID();
$entries = $this->service->getDashboardEvents($userId);
return new DataResponse($entries);
}
/**
* Get up to 3 events in the next 7 days
* sorted by their start timestamp ascending
*
* Required capability: `mutual-calendar-events`
*
* @return DataResponse<Http::STATUS_OK, list<TalkDashboardEvent>, array{}>|DataResponse<Http::STATUS_FORBIDDEN, null, array{}>
*
* 200: A list of dashboard entries or an empty array
* 403: Room is not a 1 to 1 room, room is invalid, or user is not participant
*/
#[NoAdminRequired]
#[RequireParticipant]
public function getMutualEvents(): DataResponse {
$userId = $this->userSession->getUser()?->getUID();
try {
$entries = $this->service->getMutualEvents($userId, $this->room);
} catch (InvalidRoomException|ParticipantNotFoundException) {
return new DataResponse(null, Http::STATUS_FORBIDDEN);
}
return new DataResponse($entries);
}
}