ISettableProvider.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. */
  39. public function setUserStatus(string $userId, string $messageId, string $status, bool $createBackup): void;
  40. /**
  41. * Revert an automatically set user status. For example after leaving a call,
  42. * change back to the previously set status. If the user has already updated
  43. * their status, this method does nothing.
  44. *
  45. * @param string $userId The user for which we want to update the status.
  46. * @param string $messageId The expected current messageId.
  47. * @param string $status The expected current status.
  48. */
  49. public function revertUserStatus(string $userId, string $messageId, string $status): void;
  50. /**
  51. * Revert an automatically set user status. For example after leaving a call,
  52. * change back to the previously set status. If the user has already updated
  53. * their status, this method does nothing.
  54. *
  55. * @param string[] $userIds The users for which we want to update the status.
  56. * @param string $messageId The expected current messageId.
  57. * @param string $status The expected current status.
  58. */
  59. public function revertMultipleUserStatus(array $userIds, string $messageId, string $status): void;
  60. }