mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 08:44:49 +00:00
commit
f00e409a9f
2 changed files with 45 additions and 6 deletions
|
@ -73,7 +73,7 @@ trait AdminReportController
|
|||
|
||||
public function showReport(Request $request, $id)
|
||||
{
|
||||
$report = Report::findOrFail($id);
|
||||
$report = Report::with('status')->findOrFail($id);
|
||||
return view('admin.reports.show', compact('report'));
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ trait AdminReportController
|
|||
public function updateSpam(Request $request, $id)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'action' => 'required|in:dismiss,approve,dismiss-all,approve-all,delete-account'
|
||||
'action' => 'required|in:dismiss,approve,dismiss-all,approve-all,delete-account,mark-spammer'
|
||||
]);
|
||||
|
||||
$action = $request->input('action');
|
||||
|
@ -342,6 +342,37 @@ trait AdminReportController
|
|||
return $res;
|
||||
}
|
||||
|
||||
if($action == 'mark-spammer') {
|
||||
AccountInterstitial::whereType('post.autospam')
|
||||
->whereItemType('App\Status')
|
||||
->whereNull('appeal_handled_at')
|
||||
->whereUserId($appeal->user_id)
|
||||
->update(['appeal_handled_at' => $now, 'is_spam' => true]);
|
||||
|
||||
$pro = Profile::whereUserId($appeal->user_id)->firstOrFail();
|
||||
|
||||
$pro->update([
|
||||
'unlisted' => true,
|
||||
'cw' => true,
|
||||
'no_autolink' => true
|
||||
]);
|
||||
|
||||
Status::whereProfileId($pro->id)
|
||||
->get()
|
||||
->each(function($report) {
|
||||
$status->is_nsfw = $meta->is_nsfw;
|
||||
$status->scope = 'public';
|
||||
$status->visibility = 'public';
|
||||
$status->save();
|
||||
StatusService::del($status->id, true);
|
||||
});
|
||||
|
||||
Cache::forget('pf:bouncer_v0:exemption_by_pid:' . $appeal->user->profile_id);
|
||||
Cache::forget('pf:bouncer_v0:recent_by_pid:' . $appeal->user->profile_id);
|
||||
Cache::forget('admin-dash:reports:spam-count');
|
||||
return $res;
|
||||
}
|
||||
|
||||
$status = $appeal->status;
|
||||
$status->is_nsfw = $meta->is_nsfw;
|
||||
$status->scope = 'public';
|
||||
|
|
|
@ -35,9 +35,17 @@
|
|||
<p class="mb-0">
|
||||
Timestamp: <span class="font-weight-bold">{{now()->parse($report->status->created_at)->format('r')}}</span>
|
||||
</p>
|
||||
<p class="" style="word-break: break-all !important;">
|
||||
URL: <span class="font-weight-bold text-primary"><a href="{{$report->status->url()}}">{{$report->status->url()}}</a></span>
|
||||
<p class="mb-0" style="word-break: break-all !important;">
|
||||
Original URL: <span class="font-weight-bold text-primary"><a href="/i/web/post/{{$report->status->id}}">{{$report->status->url()}}</a></span>
|
||||
</p>
|
||||
<p class="" style="word-break: break-all !important;">
|
||||
Local URL: <span class="font-weight-bold text-primary"><a href="/i/web/post/{{$report->status->id}}">{{url('/i/web/post/' . $report->status->id)}}</a></span>
|
||||
</p>
|
||||
@if($report->status->in_reply_to_id)
|
||||
<p class="mt-n3" style="word-break: break-all !important;">
|
||||
Parent Post: <span class="font-weight-bold text-primary"><a href="/i/web/post/{{$report->status->in_reply_to_id}}">{{url('/i/web/post/' . $report->status->in_reply_to_id)}}</a></span>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -49,7 +57,7 @@
|
|||
|
||||
<div class="card shadow-none border mt-5">
|
||||
<div class="card-header text-center font-weight-bold bg-light">
|
||||
@{{$report->reportedUser->username}} stats
|
||||
{{$report->reportedUser->username}} stats
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
|
@ -108,4 +116,4 @@
|
|||
});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
|
Loading…
Reference in a new issue