diff --git a/src/controller.php b/src/controller.php index b008b84..11ac63f 100644 --- a/src/controller.php +++ b/src/controller.php @@ -253,6 +253,9 @@ function controller() { if ($jsonld['actor'] == $jsonld['object']) { $pdo = $db->prepare('delete from `users` where `actor` = :actor'); $pdo->execute([':actor' => $jsonld['actor']]); + } else { + $jsonld['object'] = ['id' => $jsonld['object']]; + Club_Tombstone_Process($jsonld); } } break; default: break; diff --git a/src/function.php b/src/function.php index 7375921..d970f11 100644 --- a/src/function.php +++ b/src/function.php @@ -117,8 +117,7 @@ function Club_Announce_Process($jsonld) { $pdo = $db->prepare('select `id` from `activities` where `object` = :object'); $pdo->execute([':object' => $jsonld['object']['id']]); if (!$pdo->fetch(PDO::FETCH_ASSOC)) { - $to = array_merge($jsonld['to'], $jsonld['cc']); - foreach ($to as $cc) if (($club_url = $base.'/club/') == substr($cc, 0, strlen($club_url))) $clubs[] = substr($cc, strlen($club_url)); + foreach ($to = array_merge($jsonld['to'], $jsonld['cc']) as $cc) if (($club_url = $base.'/club/') == substr($cc, 0, strlen($club_url))) $clubs[] = substr($cc, strlen($club_url)); if (!empty($clubs) && in_array($public_streams, $to)) { $actor = Club_Get_Actor($clubs[0], $jsonld['actor']); $pdo = $db->prepare('insert into `activities`(`uid`,`type`,`clubs`,`object`,`timestamp`)'.