Merge pull request #3592 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-07-26 04:54:19 -06:00 committed by GitHub
commit f00e409a9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 6 deletions

View file

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

View file

@ -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">
&commat;{{$report->reportedUser->username}} stats
{{$report->reportedUser->username}} stats
</div>
<div class="card-body">
<p>
@ -108,4 +116,4 @@
});
})
</script>
@endpush
@endpush