-
Notifications
You must be signed in to change notification settings - Fork 508
Adjust notifier to Nextcloud 17 #2003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
nickvergessen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanation how to update your Notifier to 17
| 'name' => $l->t('Talk'), | ||
| ]; | ||
| }); | ||
| $manager->registerNotifierService(Notifier::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Register with the class name, instead of a closure
| * @since 17.0.0 | ||
| */ | ||
| public function getID(): string { | ||
| return 'talk'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New method in 17, replacing the id return of the info closure from the old registration way
| * @since 17.0.0 | ||
| */ | ||
| public function getName(): string { | ||
| return $this->lFactory->get('spreed')->t('Talk'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New method in 17, replacing the name return of the info closure from the old registration way
| * @since 9.0.0 | ||
| */ | ||
| public function prepare(INotification $notification, $languageCode): INotification { | ||
| public function prepare(INotification $notification, string $languageCode): INotification { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hint for $languageCode is new, and the : INotification return type is enforced now too.
| $participant = $room->getParticipant($userId); | ||
| } catch (ParticipantNotFoundException $e) { | ||
| // Room does not exist | ||
| $this->notificationManager->markProcessed($notification); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of marking as processed in the prepare method, throw a AlreadyProcessedException which will correctly delete the notification on all devices.
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
9a323b1 to
ebf7781
Compare
|
Rebased to trigger working tests and added some more buttons as requested by jan in #577 |
Ref nextcloud/server#15040
Fix #577