Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-10-07 20:34:55 +0300
committerJoas Schilling <coding@schilljs.com>2021-10-11 17:26:08 +0300
commit0c379ce84611f6a1c464c8d44ee96dd476621fcc (patch)
tree7d9a7d84d02353f2cc9c20ca55e0ec8a75339811 /lib/Service
parentf772525127c6c60ac64d605258b977fb5604f942 (diff)
Add API to opt out of call notifications
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service')
-rw-r--r--lib/Service/ParticipantService.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php
index 8eb594270..8cd742d18 100644
--- a/lib/Service/ParticipantService.php
+++ b/lib/Service/ParticipantService.php
@@ -221,6 +221,23 @@ class ParticipantService {
}
/**
+ * @param Participant $participant
+ * @param int $level
+ */
+ public function updateNotificationCalls(Participant $participant, int $level): void {
+ if (!\in_array($level, [
+ Participant::NOTIFY_CALLS_OFF,
+ Participant::NOTIFY_CALLS_ON,
+ ], true)) {
+ throw new \InvalidArgumentException('Invalid notification level');
+ }
+
+ $attendee = $participant->getAttendee();
+ $attendee->setNotificationCalls($level);
+ $this->attendeeMapper->update($attendee);
+ }
+
+ /**
* @param Room $room
* @param IUser $user
* @param string $password