mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update tombstone handler
This commit is contained in:
parent
d3eaccf706
commit
d06622b7d4
1 changed files with 11 additions and 7 deletions
|
@ -307,11 +307,8 @@ class Inbox
|
||||||
$id = $this->payload['object']['id'];
|
$id = $this->payload['object']['id'];
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'Person':
|
case 'Person':
|
||||||
$profile = Profile::whereNull('domain')
|
$profile = Helpers::fetchProfile($actor);
|
||||||
->whereNull('private_key')
|
if(!$profile || $profile->private_key != null) {
|
||||||
->whereRemoteUrl($id)
|
|
||||||
->first();
|
|
||||||
if(!$profile) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Notification::whereActorId($profile->id)->delete();
|
Notification::whereActorId($profile->id)->delete();
|
||||||
|
@ -326,11 +323,18 @@ class Inbox
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Tombstone':
|
case 'Tombstone':
|
||||||
$status = Status::whereUri($id)->orWhere('object_url', $id)->first();
|
$profile = Helpers::fetchProfile($actor);
|
||||||
|
$status = Status::whereProfileId($profile->id)
|
||||||
|
->whereUri($id)
|
||||||
|
->orWhereUrl($id)
|
||||||
|
->orWhere('object_url', $id)
|
||||||
|
->first();
|
||||||
if(!$status) {
|
if(!$status) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$status->media->delete();
|
$status->media()->delete();
|
||||||
|
$status->likes()->delete();
|
||||||
|
$status->shares()->delete();
|
||||||
$status->delete();
|
$status->delete();
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue