Process incoming relay posts / fix importing posts

This commit is contained in:
Michael 2020-09-14 20:58:41 +00:00
parent 87e0ba2af6
commit 4930991734
2 changed files with 65 additions and 17 deletions

View file

@ -711,15 +711,22 @@ class Processor
return '';
}
if (!empty($child['author'])) {
$actor = $child['author'];
} elseif (!empty($object['actor'])) {
$actor = $object['actor'];
if (!empty($object['actor'])) {
$object_actor = $object['actor'];
} elseif (!empty($object['attributedTo'])) {
$actor = $object['attributedTo'];
$object_actor = $object['attributedTo'];
} else {
// Shouldn't happen
$actor = '';
$object_actor = '';
}
$signer = [$object_actor];
if (!empty($child['author'])) {
$actor = $child['author'];
$signer[] = $actor;
} else {
$actor = $object_actor;
}
if (!empty($object['published'])) {
@ -745,7 +752,7 @@ class Processor
$ldactivity['thread-completion'] = true;
ActivityPub\Receiver::processActivity($ldactivity, json_encode($activity), $uid, true, false, [$actor]);
ActivityPub\Receiver::processActivity($ldactivity, json_encode($activity), $uid, true, false, $signer);
Logger::notice('Activity had been fetched and processed.', ['url' => $url, 'object' => $activity['id']]);