Skip to content

Commit

Permalink
fix pleroma delete
Browse files Browse the repository at this point in the history
  • Loading branch information
fghrsh committed Oct 29, 2021
1 parent 10fbad2 commit e899281
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -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`)'.
Expand Down

0 comments on commit e899281

Please sign in to comment.