Allow creation of custom flags, which auto hide content, similar to "spam" and "inapproriate"

AI-generated summary

A feature request has been made to allow admins to create custom flags that auto-hide content, similar to the “spam” and “inappropriate” flags. thoka discovered that custom flags can be enabled to auto-hide content by setting auto_action_type to true via the console. However, this option is not currently available in the admin user interface.

thoka shared a rails console command to enable the “auto hide” feature for a custom moderation flag. tobiaseigen confirmed that the suggestion is to add a toggle to the UI when editing custom flags, allowing admins to choose which flags have this feature.

tobiaseigen stated that adding this toggle is being considered, and it shouldn’t be too difficult to implement. The feature has now been added in a PR (#9), allowing admins to enable or disable auto-hiding content for custom flags through the moderation flags admin page.

I am delighted that it is now possible to create custom moderation flags.

During testing, it was noted that initially, it seemed impossible to equip these with the same functionality as the predefined “spam” and “inappropriate” flags.

After setting auto_action_type to true via console, the flags behave as wanted.

Please add this option to the admin user interface too.

4 Likes

“auto hide” for a custom moderation flag can be enabled using the rails console:

Flag.find(1001).update!(auto_action_type: true)
1 Like

Thanks for sharing that rails hack!

So is the suggestion to add a toggle to the UI when editing custom flags? So some flags have it and others do not, at the discretion of the admin?

1 Like

Exactly. (Will need enabling of editing of custom flags :innocent:)

1 Like

We’re going to be looking into adding this toggle. Shouldn’t be too difficult.

3 Likes

The toggle has now been added, in this PR: FEATURE: auto_action_type field for flags by KrisKotlarek · Pull Request #29306 · discourse/discourse · GitHub

The moderation flags admin page looks like this now:

3 Likes

This topic was automatically closed after 4 days. New replies are no longer allowed.