[ActivityPub][INBOX][Delete] Stop if the ID is not present
This commit is contained in:
parent
647bf8c953
commit
96f1cc1a5c
@ -275,10 +275,13 @@ class Activitypub_inbox_handler
|
|||||||
// If it's gone, we don't know the type of the deleted object, we only have a Tombstone
|
// If it's gone, we don't know the type of the deleted object, we only have a Tombstone
|
||||||
// If we were given an array, we don't know if it's Gone or not via status code...
|
// If we were given an array, we don't know if it's Gone or not via status code...
|
||||||
// In both cases, we will want to fetch the ID and act on that as it is easier than updating the fields
|
// In both cases, we will want to fetch the ID and act on that as it is easier than updating the fields
|
||||||
|
$object = $object['id'] ?? null;
|
||||||
|
if (is_null($object)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Was it a profile?
|
// Was it a profile?
|
||||||
try {
|
try {
|
||||||
$object = $object['id'];
|
|
||||||
$aprofile = Activitypub_profile::fromUri($object, false);
|
$aprofile = Activitypub_profile::fromUri($object, false);
|
||||||
$res = Activitypub_explorer::get_remote_user_activity($object);
|
$res = Activitypub_explorer::get_remote_user_activity($object);
|
||||||
Activitypub_profile::update_profile($aprofile, $res);
|
Activitypub_profile::update_profile($aprofile, $res);
|
||||||
@ -291,7 +294,7 @@ class Activitypub_inbox_handler
|
|||||||
try {
|
try {
|
||||||
$client = new HTTPClient();
|
$client = new HTTPClient();
|
||||||
/*$response =*/ $client->get($object, ACTIVITYPUB_HTTP_CLIENT_HEADERS);
|
/*$response =*/ $client->get($object, ACTIVITYPUB_HTTP_CLIENT_HEADERS);
|
||||||
// If it was deleted
|
// If it were deleted
|
||||||
//if (!$response->isOk()) { // 410 or 404
|
//if (!$response->isOk()) { // 410 or 404
|
||||||
$notice = ActivityPubPlugin::grab_notice_from_url($object, false);
|
$notice = ActivityPubPlugin::grab_notice_from_url($object, false);
|
||||||
if ($notice instanceof Notice) {
|
if ($notice instanceof Notice) {
|
||||||
|
Loading…
Reference in New Issue
Block a user