diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-04 15:19:19 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-07-09 11:37:49 +0200 |
commit | 429305bb8aaedac3c9176d81b58368a34e492ae1 (patch) | |
tree | 520c1b26d51e0bd5cd4c4e5f3b31ec037347384c /lib/Controller/PageController.php | |
parent | 78836260e467bba23bd827c6d4184a75b4208c63 (diff) |
Defer sending the notifications when we interact multiple times
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller/PageController.php')
-rw-r--r-- | lib/Controller/PageController.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index d3246e1d0..58acd72b0 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -187,6 +187,7 @@ class PageController extends Controller { try { $room = $this->manager->getRoomByToken($token); $notification = $this->notificationManager->createNotification(); + $shouldFlush = $this->notificationManager->defer(); try { $notification->setApp('spreed') ->setUser($this->userId) @@ -198,6 +199,10 @@ class PageController extends Controller { $this->logger->logException($e, ['app' => 'spreed']); } + if ($shouldFlush) { + $this->notificationManager->flush(); + } + // If the room is not a public room, check if the user is in the participants if ($room->getType() !== Room::PUBLIC_CALL) { $this->manager->getRoomForParticipant($room->getId(), $this->userId); |