Update Inbox, improve tombstone query efficiency

pull/4822/head
Daniel Supernault 2 years ago
parent 6dceb6f05b
commit 759a439334
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -404,7 +404,7 @@ class Inbox
$status->uri = $activity['id']; $status->uri = $activity['id'];
$status->object_url = $activity['id']; $status->object_url = $activity['id'];
$status->in_reply_to_profile_id = $profile->id; $status->in_reply_to_profile_id = $profile->id;
$status->save(); $status->saveQuietly();
$dm = new DirectMessage; $dm = new DirectMessage;
$dm->to_id = $profile->id; $dm->to_id = $profile->id;
@ -704,15 +704,17 @@ class Inbox
if(!$profile || $profile->private_key != null) { if(!$profile || $profile->private_key != null) {
return; return;
} }
$status = Status::whereProfileId($profile->id)
->where(function($q) use($id) { $status = Status::where('object_url', $id)->first();
return $q->where('object_url', $id) if(!$status) {
->orWhere('url', $id); $status = Status::where('url', $id)->first();
})
->first();
if(!$status) { if(!$status) {
return; return;
} }
}
if($status->profile_id != $profile->id) {
return;
}
if($status->scope && in_array($status->scope, ['public', 'unlisted', 'private'])) { if($status->scope && in_array($status->scope, ['public', 'unlisted', 'private'])) {
if($status->type && !in_array($status->type, ['story:reaction', 'story:reply', 'reply'])) { if($status->type && !in_array($status->type, ['story:reaction', 'story:reply', 'reply'])) {
FeedRemoveRemotePipeline::dispatch($status->id, $status->profile_id)->onQueue('feed'); FeedRemoveRemotePipeline::dispatch($status->id, $status->profile_id)->onQueue('feed');

Loading…
Cancel
Save