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

[Flags] Create an event for flag creation #2551

Closed
matteocontrini opened this issue Jan 18, 2021 · 4 comments · Fixed by flarum/flags#35
Closed

[Flags] Create an event for flag creation #2551

matteocontrini opened this issue Jan 18, 2021 · 4 comments · Fixed by flarum/flags#35
Milestone

Comments

@matteocontrini
Copy link
Contributor

matteocontrini commented Jan 18, 2021

Currently, the flarum/flags extension only has an event for when a flag is being deleted (FlagsWillBeDeleted).

It would be useful to have an event for when a flag is created as well (more precisely, when a user flags a post).

A possible use-case would be, for example, an extension that generates an "external" notification for admins/moderators when a flag is created. (With external I mean an email or a message in a Telegram group, for example.)

Relevant discussion on discuss: https://discuss.flarum.org/d/25981-listening-to-flag-creation

@askvortsov1
Copy link
Sponsor Member

For that matter, it would be nice to update the naming scheme for flags event to fit better with what we're using in core and modern extensions.

@imorland
Copy link
Member

I'll happily take this on and submit a PR - this would be very useful for me too..

@askvortsov1 When I rename the FlagsWillBeDeleted, would it be better to deprecate for a release cycle and dispatch the old and new, or just swap out?

@askvortsov1
Copy link
Sponsor Member

Thank you! And yeah we'd want to deprecate it first.

@askvortsov1
Copy link
Sponsor Member

Fixed in flarum/flags#35

@askvortsov1 askvortsov1 added this to the 0.1.0-beta.16 milestone Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants