Skip to content

Commit

Permalink
Merge pull request #142 from nextcloud/feature/noid/allow-notifiers-t…
Browse files Browse the repository at this point in the history
…o-know-if-we-prepare-push-notifications

Allow notifiers to know if we prepare push notifications
  • Loading branch information
MorrisJobke authored Jul 20, 2018
2 parents 560cbce + 39f8b52 commit 29b8987
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Push.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ public function pushToDevice(INotification $notification) {
$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);
Expand Down

0 comments on commit 29b8987

Please sign in to comment.