Skip to content
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

Merged
merged 1 commit into from
Dec 10, 2019

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Dec 9, 2019

@rullzer rullzer added enhancement 3. to review Waiting for reviews labels Dec 9, 2019
@rullzer rullzer added this to the Nextcloud 18 milestone Dec 9, 2019
@nickvergessen
Copy link
Member

👍 but the name feels weird. It should reflect that it belongs to INotifier?

@rullzer
Copy link
Member Author

rullzer commented Dec 9, 2019

+1 but the name feels weird. It should reflect that it belongs to INotifier?

other suggestions?

@nickvergessen
Copy link
Member

In User/group backends we call them I*Backend.
So IDismissNotifier would match the pattern, or something like IOnDismissNotifier

@rullzer
Copy link
Member Author

rullzer commented Dec 9, 2019

Lets go for IDismissNotifier :)

@ChristophWurst
Copy link
Member

IDismissableNotifier?

@rullzer
Copy link
Member Author

rullzer commented Dec 9, 2019

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface IHandleDismissedNotification {
interface IHandleDismissedNotification extends INotifier {

Then you can assume an object is both if you do

if ($notifier instanceof IHandleDismissedNotification) {
 ...
}

Copy link
Member

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 {
and friends)

Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, brain fail

@rullzer
Copy link
Member Author

rullzer commented Dec 9, 2019

See also nextcloud/notifications#508

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@rullzer
Copy link
Member Author

rullzer commented Dec 9, 2019

rebased and squased
@nickvergessen please give it your final look ;)

@@ -85,4 +85,10 @@ public function setPreparingPushNotification(bool $preparingPushNotification): v
* @since 14.0.0
*/
public function isPreparingPushNotification(): bool;

/**
* @return void
Copy link
Member

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>
@rullzer rullzer merged commit 162b470 into master Dec 10, 2019
@rullzer rullzer deleted the enh/notification_dismiss branch December 10, 2019 10:30
@rullzer rullzer mentioned this pull request Dec 11, 2019
43 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants