diff options
author | Joas Schilling <coding@schilljs.com> | 2018-07-13 14:35:12 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-07-20 12:56:07 +0300 |
commit | 39f8b52fe4a130433aedda2aec36ffcb1ffdd707 (patch) | |
tree | c13e6d4be93d518d5adbb5d361e10821dc6c5c43 | |
parent | 560cbce688c64203fc0dffaa447b0c945dba3ec9 (diff) |
Allow notifiers to know if we prepare push notifications
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | lib/Push.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Push.php b/lib/Push.php index 61b802e..86bef0a 100644 --- a/lib/Push.php +++ b/lib/Push.php @@ -84,9 +84,12 @@ class Push { $language = \is_string($language) ? $language : $this->config->getUserValue($notification->getUser(), 'core', 'lang', null); $language = $language ?? $this->config->getSystemValue('default_language', 'en'); try { + $this->notificationManager->setPreparingPushNotification(true); $notification = $this->notificationManager->prepare($notification, $language); } catch (\InvalidArgumentException $e) { return; + } finally { + $this->notificationManager->setPreparingPushNotification(false); } $userKey = $this->keyManager->getKey($user); |