- /**
- * Try to delete the remote (unwanted) item
- *
- * @param array $item
- */
- private static function remoteDelete(array $item)
- {
- if ($item['gravity'] == GRAVITY_PARENT) {
- return;
- }
- return;
-
- $owner = User::getOwnerDataById($item['uid']);
- $contact = Contact::getById($item['contact-id']);
-
- if (FContact::getByURL($contact['addr'], false)) {
- Logger::info('Send Diaspora retraction for post', ['addr' => $contact['addr'], 'item' => $item]);
- Diaspora::sendRetraction($item, $owner, $contact, in_array($item['private'], [self::UNLISTED, self::PUBLIC]));
- } elseif ($profile = APContact::getByURL($contact['url'], false)) {
- Logger::info('Send ActivityPub deletion for post', ['url' => $contact['url'], 'item' => $item]);
- $data = ['@context' => ActivityPub::CONTEXT,
- 'id' => $item['uri'] . '/Delete',
- 'type' => 'Delete',
- 'actor' => $owner['url'],
- 'object' => ['type' => 'Tombstone', 'id' => $item['uri']],
- 'to' => [$profile['url']]];
-
- $signed = LDSignature::sign($data, $owner);
- return HTTPSignature::transmit($signed, $profile['inbox'], $item['uid']);
- } else {
- Logger::info('Unsupported protocol for deletion', ['network' => $contact['network']]);
- }
- }
-