mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update Inbox, improve tombstone query efficiency
This commit is contained in:
parent
6dceb6f05b
commit
759a439334
1 changed files with 9 additions and 7 deletions
|
@ -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,13 +704,15 @@ 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)
|
|
||||||
->orWhere('url', $id);
|
|
||||||
})
|
|
||||||
->first();
|
|
||||||
if(!$status) {
|
if(!$status) {
|
||||||
|
$status = Status::where('url', $id)->first();
|
||||||
|
if(!$status) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($status->profile_id != $profile->id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if($status->scope && in_array($status->scope, ['public', 'unlisted', 'private'])) {
|
if($status->scope && in_array($status->scope, ['public', 'unlisted', 'private'])) {
|
||||||
|
|
Loading…
Reference in a new issue