Add ReblogService, improve reblogged state for api entities

This commit is contained in:
Daniel Supernault 2022-01-28 22:06:43 -07:00
parent a7d715517d
commit 6cfd6be523
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
5 changed files with 50 additions and 7 deletions

View file

@ -25,6 +25,7 @@ use Illuminate\Support\Str;
use App\Services\HashidService;
use App\Services\StatusService;
use App\Util\Media\License;
use App\Services\ReblogService;
class StatusController extends Controller
{
@ -245,6 +246,7 @@ class StatusController extends Controller
->get();
foreach ($shares as $share) {
UndoSharePipeline::dispatch($share);
ReblogService::del($profile->id, $status->id);
$count--;
}
} else {
@ -255,6 +257,7 @@ class StatusController extends Controller
$share->save();
$count++;
SharePipeline::dispatch($share);
ReblogService::add($profile->id, $status->id);
}
Cache::forget('status:'.$status->id.':sharedby:userid:'.$user->id);