diff options
Diffstat (limited to 'apps/user_status/lib/Connector/UserStatusProvider.php')
-rw-r--r-- | apps/user_status/lib/Connector/UserStatusProvider.php | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/apps/user_status/lib/Connector/UserStatusProvider.php b/apps/user_status/lib/Connector/UserStatusProvider.php index 1197d19c3ab..e84d69d1eb2 100644 --- a/apps/user_status/lib/Connector/UserStatusProvider.php +++ b/apps/user_status/lib/Connector/UserStatusProvider.php @@ -3,42 +3,25 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2020, Georg Ehrke - * - * @author Georg Ehrke <oc.list@georgehrke.com> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCA\UserStatus\Connector; +use OC\UserStatus\ISettableProvider; use OCA\UserStatus\Service\StatusService; use OCP\UserStatus\IProvider; -class UserStatusProvider implements IProvider { - - /** @var StatusService */ - private $service; +class UserStatusProvider implements IProvider, ISettableProvider { /** * UserStatusProvider constructor. * * @param StatusService $service */ - public function __construct(StatusService $service) { - $this->service = $service; + public function __construct( + private StatusService $service, + ) { } /** @@ -54,4 +37,16 @@ class UserStatusProvider implements IProvider { return $userStatuses; } + + public function setUserStatus(string $userId, string $messageId, string $status, bool $createBackup, ?string $customMessage = null): void { + $this->service->setUserStatus($userId, $status, $messageId, $createBackup, $customMessage); + } + + public function revertUserStatus(string $userId, string $messageId, string $status): void { + $this->service->revertUserStatus($userId, $messageId); + } + + public function revertMultipleUserStatus(array $userIds, string $messageId, string $status): void { + $this->service->revertMultipleUserStatus($userIds, $messageId); + } } |