diff --git a/CHANGELOG.md b/CHANGELOG.md index 86b3f52e3..f6e608d69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ - Update PhotoAlbumPresenter.vue, fix fullscreen mode ([822e9888](https://github.com/pixelfed/pixelfed/commit/822e9888)) - Update Timeline.vue, improve CHT pagination ([9c43e7e2](https://github.com/pixelfed/pixelfed/commit/9c43e7e2)) - Update HomeFeedPipeline, fix StatusService validation ([041c0135](https://github.com/pixelfed/pixelfed/commit/041c0135)) +- Update Inbox, improve tombstone query efficiency ([759a4393](https://github.com/pixelfed/pixelfed/commit/759a4393)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.9 (2023-08-21)](https://github.com/pixelfed/pixelfed/compare/v0.11.8...v0.11.9) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index 05049a66f..0dd4722e9 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -404,7 +404,7 @@ class Inbox $status->uri = $activity['id']; $status->object_url = $activity['id']; $status->in_reply_to_profile_id = $profile->id; - $status->save(); + $status->saveQuietly(); $dm = new DirectMessage; $dm->to_id = $profile->id; @@ -704,13 +704,15 @@ class Inbox if(!$profile || $profile->private_key != null) { return; } - $status = Status::whereProfileId($profile->id) - ->where(function($q) use($id) { - return $q->where('object_url', $id) - ->orWhere('url', $id); - }) - ->first(); + + $status = Status::where('object_url', $id)->first(); if(!$status) { + $status = Status::where('url', $id)->first(); + if(!$status) { + return; + } + } + if($status->profile_id != $profile->id) { return; } if($status->scope && in_array($status->scope, ['public', 'unlisted', 'private'])) {