Fix regression in comment mutes/blocks

This commit is contained in:
Daniel Supernault 2019-07-20 20:09:46 -06:00
parent 2cd389e229
commit 60e9d547ae
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
3 changed files with 36 additions and 1 deletions

View file

@ -13,6 +13,7 @@ use App\Jobs\StatusPipeline\NewStatusPipeline;
use App\Util\Lexer\Autolink;
use App\Profile;
use App\Status;
use App\UserFilter;
use League\Fractal;
use App\Transformer\Api\StatusTransformer;
use League\Fractal\Serializer\ArraySerializer;
@ -57,6 +58,16 @@ class CommentController extends Controller
return;
}
$filtered = UserFilter::whereUserId($status->profile_id)
->whereFilterableType('App\Profile')
->whereIn('filter_type', ['mute', 'block'])
->whereFilterableId($profile->id)
->exists();
if($filtered == true) {
return;
}
$reply = DB::transaction(function() use($comment, $status, $profile) {
$autolink = Autolink::create()->autolink($comment);
$reply = new Status();