Add StatusView model to store views for discover algorithm
This commit is contained in:
parent
ea0c1e80c6
commit
7a68ee948a
3 changed files with 61 additions and 0 deletions
|
@ -10,6 +10,7 @@ use App\AccountInterstitial;
|
|||
use App\Media;
|
||||
use App\Profile;
|
||||
use App\Status;
|
||||
use App\StatusView;
|
||||
use App\Transformer\ActivityPub\StatusTransformer;
|
||||
use App\Transformer\ActivityPub\Verb\Note;
|
||||
use App\User;
|
||||
|
@ -59,6 +60,14 @@ class StatusController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if($request->user() && $request->user()->profile_id != $status->profile_id) {
|
||||
StatusView::firstOrCreate([
|
||||
'status_id' => $status->id,
|
||||
'status_profile_id' => $status->profile_id,
|
||||
'profile_id' => $request->user()->profile_id
|
||||
]);
|
||||
}
|
||||
|
||||
if ($request->wantsJson() && config('federation.activitypub.enabled')) {
|
||||
return $this->showActivityPub($request, $status);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue