-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Add interface for notification handler for dimissed events #18297
Conversation
👍 but the name feels weird. It should reflect that it belongs to INotifier? |
other suggestions? |
In User/group backends we call them I*Backend. |
Lets go for |
|
I like that even better |
* This can be useful if dismissing the notification will leave it in an incomplete | ||
* state. The handler can chose to for example do some default action. | ||
*/ | ||
interface IHandleDismissedNotification { |
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.
interface IHandleDismissedNotification { | |
interface IHandleDismissedNotification extends INotifier { |
Then you can assume an object is both if you do
if ($notifier instanceof IHandleDismissedNotification) {
...
}
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.
(just like
interface IActivatableAtLogin extends IProvider { |
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.
But we can't have more Interfaces in the future, if they are not linear?
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.
@nickvergessen well you can if they all extend the base notifier
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.
Right, brain fail
See also nextcloud/notifications#508 |
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.
Looks good!
41ff90e
to
23e37eb
Compare
rebased and squased |
lib/public/Notification/IManager.php
Outdated
@@ -85,4 +85,10 @@ public function setPreparingPushNotification(bool $preparingPushNotification): v | |||
* @since 14.0.0 | |||
*/ | |||
public function isPreparingPushNotification(): bool; | |||
|
|||
/** | |||
* @return void |
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.
Normally we dont document void, but well :P
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
23e37eb
to
2b58181
Compare
For nextcloud/notifications#477