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
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-04 18:21:57 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-06-08 15:54:36 +0300
commite18db3bdc8ad4c72aa4fa3a7e2b0481cfdbf0e95 (patch)
tree60e9c6a49247f4cea6f40235e12c21a785ad5d47 /lib
parent51c766f82d42e8441bdd0341ffe39d8b3bdb5c02 (diff)
Do not query the participants for pushing call notifications
We can skip the participant check when we generate push notifications. We just looped over the participants to create the notifications, they can not be removed between these 2 steps, so we can save all those queries. Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Notification/Notifier.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php
index 092cf186b..9ff13f7a6 100644
--- a/lib/Notification/Notifier.php
+++ b/lib/Notification/Notifier.php
@@ -179,11 +179,18 @@ class Notifier implements INotifier {
throw new AlreadyProcessedException();
}
- try {
- $participant = $room->getParticipant($userId);
- } catch (ParticipantNotFoundException $e) {
- // Room does not exist
- throw new AlreadyProcessedException();
+ if ($this->notificationManager->isPreparingPushNotification() && $notification->getSubject() === 'call') {
+ // Skip the participant check when we generate push notifications
+ // we just looped over the participants to create the notification,
+ // they can not be removed between these 2 steps, but we can save
+ // n queries.
+ } else {
+ try {
+ $participant = $room->getParticipant($userId);
+ } catch (ParticipantNotFoundException $e) {
+ // Room does not exist
+ throw new AlreadyProcessedException();
+ }
}
$notification