IAvailabilityCoordinator.php 932 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\User;
  8. use OCP\IUser;
  9. /**
  10. * Coordinator for availability and out-of-office messages
  11. *
  12. * @since 28.0.0
  13. */
  14. interface IAvailabilityCoordinator {
  15. /**
  16. * Check if the feature is enabled on this instance
  17. *
  18. * @return bool
  19. *
  20. * @since 28.0.0
  21. */
  22. public function isEnabled(): bool;
  23. /**
  24. * Get the user's out-of-office message, if any
  25. *
  26. * @since 28.0.0
  27. */
  28. public function getCurrentOutOfOfficeData(IUser $user): ?IOutOfOfficeData;
  29. /**
  30. * Reset the absence cache to null
  31. *
  32. * @since 28.0.0
  33. */
  34. public function clearCache(string $userId): void;
  35. /**
  36. * Is the absence in effect at this moment
  37. *
  38. * @param IOutOfOfficeData $data
  39. * @return bool
  40. * @since 28.0.0
  41. */
  42. public function isInEffect(IOutOfOfficeData $data): bool;
  43. }