reintroduced fixes for nc17

Signed-off-by: Felix Nüsse <felix.nuesse@t-online.de>
This commit is contained in:
Felix Nüsse 2019-11-13 23:05:12 +01:00
parent 5dafe2d648
commit 40bf5cfdb6
No known key found for this signature in database
GPG key ID: 2089A3431243E819
2 changed files with 20 additions and 13 deletions

View file

@ -26,17 +26,7 @@ $app->registerPersonalPage();
$l = \OC::$server->getL10N('passman');
$manager = \OC::$server->getNotificationManager();
$manager->registerNotifier(function() {
return new Notifier(
\OC::$server->getL10NFactory()
);
}, function() use ($l) {
return [
'id' => 'passman',
'name' => $l->t('Passwords'),
];
});
$manager->registerNotifierService(Notifier::class);
/**
* Loading translations
*

View file

@ -37,7 +37,7 @@ class Notifier implements INotifier {
* @param INotification $notification
* @param string $languageCode The code of the language that should be used to prepare the notification
*/
public function prepare(INotification $notification, $languageCode) {
public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getApp() !== 'passman') {
// Not my app => throw
throw new \InvalidArgumentException();
@ -109,4 +109,21 @@ class Notifier implements INotifier {
throw new \InvalidArgumentException();
}
}
/**
* Identifier of the notifier
*
* @return string
*/
public function getID(): string {
return 'passman';
}
/**
* Human readable name describing the notifier
*
* @return string
*/
public function getName(): string {
return $this->factory->get('passman')->t('Passwords');
}
}