mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 13:03:16 +00:00
Update AutoSpam Bouncer, generate notification on positive detections
This commit is contained in:
parent
0d3b4bc225
commit
d5f63f8a71
1 changed files with 11 additions and 0 deletions
|
@ -6,8 +6,10 @@ use App\AccountInterstitial;
|
|||
use App\Status;
|
||||
use Cache;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Services\NotificationService;
|
||||
use App\Services\StatusService;
|
||||
use App\Jobs\ReportPipeline\AutospamNotifyAdminViaEmail;
|
||||
use App\Notification;
|
||||
|
||||
class Bouncer {
|
||||
|
||||
|
@ -140,6 +142,15 @@ class Bouncer {
|
|||
// $status->is_nsfw = true;
|
||||
$status->save();
|
||||
|
||||
$notification = new Notification();
|
||||
$notification->profile_id = $status->profile_id;
|
||||
$notification->actor_id = $status->profile_id;
|
||||
$notification->action = 'autospam.warning';
|
||||
$notification->item_id = $status->id;
|
||||
$notification->item_type = "App\Status";
|
||||
$notification->save();
|
||||
NotificationService::add($notification->profile_id, $notification->id);
|
||||
|
||||
StatusService::del($status->id);
|
||||
|
||||
Cache::forget('pf:bouncer_v0:exemption_by_pid:' . $status->profile_id);
|
||||
|
|
Loading…
Reference in a new issue