mirror of
https://github.com/nextcloud/passman.git
synced 2025-11-08 05:04:04 +08:00
Merge branch 'gouttegd-fix/issue-610'
This commit is contained in:
commit
ec89cd12ac
2 changed files with 21 additions and 14 deletions
|
|
@ -23,19 +23,8 @@ $app = new \OCA\Passman\AppInfo\Application();
|
|||
$app->registerNavigationEntry();
|
||||
$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
|
||||
|
|
|
|||
|
|
@ -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,22 @@ 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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue