summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-04-30 15:33:09 +0200
committerJoas Schilling <coding@schilljs.com>2024-04-30 15:33:09 +0200
commit847c7ec3380d426bf6ec7a0d1092393f59d34a17 (patch)
tree6cbc2d0cae5800e00ef4685f7f798c241a9e366a
parentd7fd9a9d900a7ab0568badc5ec67f188556536e0 (diff)
fixup! fix(notifications): Preparse call notifications for improved performancedebug/noid/starting-a-big-call-takes-long
-rw-r--r--lib/Notification/Listener.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Notification/Listener.php b/lib/Notification/Listener.php
index f0f7a1037..51e8bfe1a 100644
--- a/lib/Notification/Listener.php
+++ b/lib/Notification/Listener.php
@@ -349,21 +349,23 @@ class Listener implements IEventListener {
$this->notificationManager->setPreparingPushNotification(true);
$this->preparedCallNotifications[$languageCode] = $this->notificationProvider->prepare($translatedNotification, $languageCode);
$this->notificationManager->setPreparingPushNotification(false);
- $notification = $translatedNotification;
+ $userNotification = $translatedNotification;
if ($room->getToken() === 'c9bui2ju') {
\OC::$server->getLogger()->warning('Debugging step #7.2.' . $languageCode . ': ' . microtime(true));
}
} else {
- $notification = $this->preparedCallNotifications[$languageCode];
+ $userNotification = $this->preparedCallNotifications[$languageCode];
if ($room->getToken() === 'c9bui2ju') {
\OC::$server->getLogger()->warning('Debugging step #7.2.reused.' . $languageCode . ': ' . microtime(true));
}
}
+ } else {
+ $userNotification = $notification;
}
try {
- $notification->setUser($userId);
- $this->notificationManager->notify($notification);
+ $userNotification->setUser($userId);
+ $this->notificationManager->notify($userNotification);
} catch (\InvalidArgumentException $e) {
$this->logger->error($e->getMessage(), ['exception' => $e]);
}