зеркало из https://github.com/nextcloud/spreed.git
Adjust notifier to Nextcloud 17
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
a3676594b1
Коммит
b2f41fc736
|
@ -129,16 +129,7 @@ class Application extends App {
|
|||
|
||||
protected function registerNotifier(IServerContainer $server): void {
|
||||
$manager = $server->getNotificationManager();
|
||||
$manager->registerNotifier(function() use ($server) {
|
||||
return $server->query(Notifier::class);
|
||||
}, function() use ($server) {
|
||||
$l = $server->getL10N('spreed');
|
||||
|
||||
return [
|
||||
'id' => 'spreed',
|
||||
'name' => $l->t('Talk'),
|
||||
];
|
||||
});
|
||||
$manager->registerNotifierService(Notifier::class);
|
||||
}
|
||||
|
||||
protected function registerCollaborationResourceProvider(IServerContainer $server): void {
|
||||
|
|
|
@ -90,6 +90,26 @@ class Notifier implements INotifier {
|
|||
$this->definitions = $definitions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the notifier, only use [a-z0-9_]
|
||||
*
|
||||
* @return string
|
||||
* @since 17.0.0
|
||||
*/
|
||||
public function getID(): string {
|
||||
return 'talk';
|
||||
}
|
||||
|
||||
/**
|
||||
* Human readable name describing the notifier
|
||||
*
|
||||
* @return string
|
||||
* @since 17.0.0
|
||||
*/
|
||||
public function getName(): string {
|
||||
return $this->lFactory->get('spreed')->t('Talk');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param INotification $notification
|
||||
* @param string $languageCode The code of the language that should be used to prepare the notification
|
||||
|
@ -97,7 +117,7 @@ class Notifier implements INotifier {
|
|||
* @throws \InvalidArgumentException When the notification was not prepared by a notifier
|
||||
* @since 9.0.0
|
||||
*/
|
||||
public function prepare(INotification $notification, $languageCode): INotification {
|
||||
public function prepare(INotification $notification, string $languageCode): INotification {
|
||||
if ($notification->getApp() !== 'spreed') {
|
||||
throw new \InvalidArgumentException('Incorrect app');
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче