Merge pull request #4822 from pixelfed/staging

Update Inbox, improve tombstone query efficiency
This commit is contained in:
daniel 2023-12-11 04:13:52 -07:00 committed by GitHub
commit a5a2f77871
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View file

@ -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)

View file

@ -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'])) {