[PLUGIN][ActivityPub] Federate out Service information in Activities
This commit is contained in:
parent
83599ef866
commit
dfc5918c2c
|
@ -30,6 +30,7 @@ namespace Plugin\ActivityPub\Util;
|
||||||
use App\Entity\Actor;
|
use App\Entity\Actor;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Plugin\ActivityPub\ActivityPub;
|
||||||
use Plugin\ActivityPub\Entity\ActivitypubRsa;
|
use Plugin\ActivityPub\Entity\ActivitypubRsa;
|
||||||
|
|
||||||
class HTTPSignature
|
class HTTPSignature
|
||||||
|
@ -91,7 +92,7 @@ class HTTPSignature
|
||||||
'Date' => $date->format('D, d M Y H:i:s \G\M\T'),
|
'Date' => $date->format('D, d M Y H:i:s \G\M\T'),
|
||||||
'Host' => parse_url($url, \PHP_URL_HOST),
|
'Host' => parse_url($url, \PHP_URL_HOST),
|
||||||
'Accept' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams", application/activity+json, application/json',
|
'Accept' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams", application/activity+json, application/json',
|
||||||
'User-Agent' => 'GNU social ActivityPub Plugin - ' . GNUSOCIAL_ENGINE_URL,
|
'User-Agent' => 'GNU social ActivityPub Plugin - v' . ActivityPub::version() . ' - ' . GNUSOCIAL_ENGINE_URL,
|
||||||
'Content-Type' => 'application/activity+json',
|
'Content-Type' => 'application/activity+json',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -177,6 +177,10 @@ class Activity extends Model
|
||||||
$attr = [
|
$attr = [
|
||||||
'type' => $gs_verb_to_activity_streams_two_verb,
|
'type' => $gs_verb_to_activity_streams_two_verb,
|
||||||
'@context' => ActivityPub::$activity_streams_two_context,
|
'@context' => ActivityPub::$activity_streams_two_context,
|
||||||
|
'instrument' => Type::create('Service', [
|
||||||
|
'name' => 'GNU social ActivityPub Plugin - v' . ActivityPub::version(),
|
||||||
|
'url' => GNUSOCIAL_ENGINE_URL,
|
||||||
|
]),
|
||||||
'id' => Router::url('activity_view', ['id' => $object->getId()], Router::ABSOLUTE_URL),
|
'id' => Router::url('activity_view', ['id' => $object->getId()], Router::ABSOLUTE_URL),
|
||||||
'published' => $object->getCreated()->format(DateTimeInterface::RFC3339),
|
'published' => $object->getCreated()->format(DateTimeInterface::RFC3339),
|
||||||
'actor' => $object->getActor()->getUri(Router::ABSOLUTE_URL),
|
'actor' => $object->getActor()->getUri(Router::ABSOLUTE_URL),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user