1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

Unapprove discussions too

This commit is contained in:
Toby Zerner
2016-06-03 10:58:05 +09:30
parent 5b79abeea1
commit 9c6466338c

View File

@@ -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;