ISettableProvider.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2021 Carl Schwan <carl@carlschwan.eu>
  5. *
  6. * @author Carl Schwan <carl@carlschwan.eu>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OC\UserStatus;
  25. use OCP\UserStatus\IProvider;
  26. /**
  27. * Interface ISettableProvider
  28. * @package OC\UserStatus
  29. */
  30. interface ISettableProvider extends IProvider {
  31. /**
  32. * Set a new status for the selected user.
  33. *
  34. * @param string $userId The user for which we want to update the status.
  35. * @param string $messageId The new message id.
  36. * @param string $status The new status.
  37. * @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).
  38. * @param string|null $customMessage
  39. */
  40. public function setUserStatus(string $userId, string $messageId, string $status, bool $createBackup, ?string $customMessage = null): void;
  41. /**
  42. * Revert an automatically set user status. For example after leaving a call,
  43. * change back to the previously set status. If the user has already updated
  44. * their status, this method does nothing.
  45. *
  46. * @param string $userId The user for which we want to update the status.
  47. * @param string $messageId The expected current messageId.
  48. * @param string $status The expected current status.
  49. */
  50. public function revertUserStatus(string $userId, string $messageId, string $status): void;
  51. /**
  52. * Revert an automatically set user status. For example after leaving a call,
  53. * change back to the previously set status. If the user has already updated
  54. * their status, this method does nothing.
  55. *
  56. * @param string[] $userIds The users for which we want to update the status.
  57. * @param string $messageId The expected current messageId.
  58. * @param string $status The expected current status.
  59. */
  60. public function revertMultipleUserStatus(array $userIds, string $messageId, string $status): void;
  61. }