mirror of
https://github.com/flarum/core.git
synced 2025-08-06 16:36:47 +02:00
Unapprove discussions too
This commit is contained in:
@@ -75,6 +75,11 @@ class FilterNewPosts
|
|||||||
$post->is_spam = true;
|
$post->is_spam = true;
|
||||||
|
|
||||||
$post->afterSave(function ($post) {
|
$post->afterSave(function ($post) {
|
||||||
|
if ($post->number == 1) {
|
||||||
|
$post->discussion->is_approved = false;
|
||||||
|
$post->discussion->save();
|
||||||
|
}
|
||||||
|
|
||||||
$flag = new Flag;
|
$flag = new Flag;
|
||||||
|
|
||||||
$flag->post_id = $post->id;
|
$flag->post_id = $post->id;
|
||||||
|
Reference in New Issue
Block a user