mirror of
https://github.com/friendica/friendica
synced 2025-04-26 13:10:11 +00:00
Improvements for the "post-reason"
This commit is contained in:
parent
a20d05ba39
commit
81aaacc67d
9 changed files with 46 additions and 43 deletions
|
@ -110,10 +110,7 @@ class Delivery
|
|||
} elseif ($cmd == WorkerDelivery::PROFILEUPDATE) {
|
||||
$success = ActivityPub\Transmitter::sendProfileUpdate($uid, $inbox);
|
||||
} else {
|
||||
$data = Post\Activity::getByURIId($uri_id);
|
||||
if (empty($data)) {
|
||||
$data = ActivityPub\Transmitter::createCachedActivityFromItem($item_id);
|
||||
}
|
||||
$data = ActivityPub\Transmitter::createCachedActivityFromItem($item_id);
|
||||
if (!empty($data)) {
|
||||
$timestamp = microtime(true);
|
||||
$response = HTTPSignature::post($data, $inbox, $uid);
|
||||
|
|
|
@ -1233,26 +1233,20 @@ class Transmitter
|
|||
if (!$item['deleted']) {
|
||||
$data = Post\Activity::getByURIId($item['uri-id']);
|
||||
if (!$item['origin'] && !empty($data)) {
|
||||
if (!empty($data['type'])) {
|
||||
if (in_array($data['type'], ['Create', 'Update'])) {
|
||||
if ($object_mode) {
|
||||
unset($data['@context']);
|
||||
unset($data['signature']);
|
||||
}
|
||||
Logger::info('Return stored conversation', ['item' => $item_id]);
|
||||
return $data;
|
||||
} elseif (in_array('as:' . $data['type'], Receiver::CONTENT_TYPES)) {
|
||||
if (!empty($data['@context'])) {
|
||||
$context = $data['@context'];
|
||||
unset($data['@context']);
|
||||
}
|
||||
unset($data['actor']);
|
||||
$object = $data;
|
||||
}
|
||||
if ($object_mode) {
|
||||
unset($data['@context']);
|
||||
unset($data['signature']);
|
||||
}
|
||||
Logger::info('Return stored conversation', ['item' => $item_id]);
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$item['origin'] && empty($object)) {
|
||||
Logger::debug('Post is not ours and is not stored', ['id' => $item_id, 'uri-id' => $item['uri-id']]);
|
||||
return false;
|
||||
}
|
||||
|
||||
$type = self::getTypeOfItem($item);
|
||||
|
||||
if (!$object_mode) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue