ISettableProvider.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\UserStatus;
  8. use OCP\UserStatus\IProvider;
  9. /**
  10. * Interface ISettableProvider
  11. * @package OC\UserStatus
  12. */
  13. interface ISettableProvider extends IProvider {
  14. /**
  15. * Set a new status for the selected user.
  16. *
  17. * @param string $userId The user for which we want to update the status.
  18. * @param string $messageId The new message id.
  19. * @param string $status The new status.
  20. * @param bool $createBackup If true, this will store the old status so that it is possible to revert it later (e.g. after a call).
  21. * @param string|null $customMessage
  22. */
  23. public function setUserStatus(string $userId, string $messageId, string $status, bool $createBackup, ?string $customMessage = null): void;
  24. /**
  25. * Revert an automatically set user status. For example after leaving a call,
  26. * change back to the previously set status. If the user has already updated
  27. * their status, this method does nothing.
  28. *
  29. * @param string $userId The user for which we want to update the status.
  30. * @param string $messageId The expected current messageId.
  31. * @param string $status The expected current status.
  32. */
  33. public function revertUserStatus(string $userId, string $messageId, string $status): void;
  34. /**
  35. * Revert an automatically set user status. For example after leaving a call,
  36. * change back to the previously set status. If the user has already updated
  37. * their status, this method does nothing.
  38. *
  39. * @param string[] $userIds The users for which we want to update the status.
  40. * @param string $messageId The expected current messageId.
  41. * @param string $status The expected current status.
  42. */
  43. public function revertMultipleUserStatus(array $userIds, string $messageId, string $status): void;
  44. }