mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update AP Inbox
This commit is contained in:
parent
919a6d6fd9
commit
d11c71cdec
1 changed files with 27 additions and 1 deletions
|
@ -271,7 +271,19 @@ class Inbox
|
|||
|
||||
public function handleDeleteActivity()
|
||||
{
|
||||
$actor = $this->payload['actor'];
|
||||
$obj = $this->payload['object'];
|
||||
if(is_string($obj) && Helpers::validateUrl($obj)) {
|
||||
// actor object detected
|
||||
|
||||
} else if (is_array($obj) && isset($obj['type']) && $obj['type'] == 'Tombstone') {
|
||||
// tombstone detected
|
||||
$status = Status::whereUri($obj['id'])->first();
|
||||
if($status == null) {
|
||||
return;
|
||||
}
|
||||
$status->forceDelete();
|
||||
}
|
||||
}
|
||||
|
||||
public function handleLikeActivity()
|
||||
|
@ -311,7 +323,21 @@ class Inbox
|
|||
$status = Helpers::statusFirstOrFetch($obj['object']);
|
||||
Like::whereProfileId($profile->id)
|
||||
->whereStatusId($status->id)
|
||||
->delete();
|
||||
->forceDelete();
|
||||
break;
|
||||
|
||||
case 'Announce':
|
||||
$parent = Helpers::statusFirstOrFetch($obj['object']);
|
||||
$status = Status::whereProfileId($profile->id)
|
||||
->whereReblogOfId($parent->id)
|
||||
->first();
|
||||
Notification::whereProfileId($parent->profile->id)
|
||||
->whereActorId($profile->id)
|
||||
->whereAction('share')
|
||||
->whereItemId($status->id)
|
||||
->whereItemType('App\Status')
|
||||
->forceDelete();
|
||||
$status->forceDelete();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue