Stop using deprecated registerNotifier, use registerNotifierService instead

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2019-08-02 16:40:35 +02:00 committed by Roeland Jago Douma
parent a6f792616c
commit c5147529af
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 6 additions and 12 deletions

View File

@ -248,20 +248,14 @@ class Application extends App {
return $this->getContainer()->query(SyncService::class); return $this->getContainer()->query(SyncService::class);
} }
public function registerNotifier() { public function registerNotifier():void {
$this->getContainer()->getServer()->getNotificationManager()->registerNotifier(function() { $this->getContainer()
return $this->getContainer()->query(Notifier::class); ->getServer()
}, function() { ->getNotificationManager()
$l = $this->getContainer()->getServer()->getL10NFactory()->get(self::APP_ID); ->registerNotifierService(Notifier::class);
return [
'id' => self::APP_ID,
'name' => $l->t('Calendars and Contacts'),
];
});
} }
public function registerCalendarReminders(): void public function registerCalendarReminders():void {
{
try { try {
/** @var NotificationProviderManager $notificationProviderManager */ /** @var NotificationProviderManager $notificationProviderManager */
$notificationProviderManager = $this->getContainer()->query(NotificationProviderManager::class); $notificationProviderManager = $this->getContainer()->query(NotificationProviderManager::class);