Go away LDS

This commit is contained in:
Diogo Cordeiro 2018-08-06 02:08:30 +01:00
parent b9c76c2901
commit edc62d4cb0
13 changed files with 13 additions and 52 deletions

View File

@ -50,10 +50,7 @@ class Activitypub_accept extends Managed_DataObject
public static function accept_to_array($object) public static function accept_to_array($object)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'id' => common_root_url().'accept_follow_from_'.urlencode($object['actor']).'_to_'.urlencode($object['object']), 'id' => common_root_url().'accept_follow_from_'.urlencode($object['actor']).'_to_'.urlencode($object['object']),
'type' => 'Accept', 'type' => 'Accept',
'actor' => $object['object'], 'actor' => $object['object'],

View File

@ -50,10 +50,7 @@ class Activitypub_announce extends Managed_DataObject
public static function announce_to_array($actor, $object) public static function announce_to_array($actor, $object)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
"type" => "Announce", "type" => "Announce",
"actor" => $actor, "actor" => $actor,
"object" => $object "object" => $object

View File

@ -50,10 +50,7 @@ class Activitypub_attachment extends Managed_DataObject
public static function attachment_to_array($attachment) public static function attachment_to_array($attachment)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'type' => 'Document', 'type' => 'Document',
'mediaType' => $attachment->mimetype, 'mediaType' => $attachment->mimetype,
'url' => $attachment->getUrl(), 'url' => $attachment->getUrl(),

View File

@ -51,10 +51,7 @@ class Activitypub_create extends Managed_DataObject
public static function create_to_array($actor, $object) public static function create_to_array($actor, $object)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'id' => $object['id'].'/create', 'id' => $object['id'].'/create',
'type' => 'Create', 'type' => 'Create',
'to' => $object['to'], 'to' => $object['to'],

View File

@ -50,10 +50,7 @@ class Activitypub_delete extends Managed_DataObject
public static function delete_to_array($actor, $object) public static function delete_to_array($actor, $object)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'id' => $object.'/delete', 'id' => $object.'/delete',
'type' => 'Delete', 'type' => 'Delete',
'actor' => $actor, 'actor' => $actor,

View File

@ -51,10 +51,7 @@ class Activitypub_follow extends Managed_DataObject
public static function follow_to_array($actor, $object) public static function follow_to_array($actor, $object)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'id' => common_root_url().'follow_from_'.urlencode($actor).'_to_'.urlencode($object), 'id' => common_root_url().'follow_from_'.urlencode($actor).'_to_'.urlencode($object),
'type' => 'Follow', 'type' => 'Follow',
'actor' => $actor, 'actor' => $actor,

View File

@ -51,10 +51,7 @@ class Activitypub_like extends Managed_DataObject
public static function like_to_array($actor, $object) public static function like_to_array($actor, $object)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'id' => common_root_url().'like_from_'.urlencode($actor).'_to_'.urlencode($object), 'id' => common_root_url().'like_from_'.urlencode($actor).'_to_'.urlencode($object),
"type" => "Like", "type" => "Like",
"actor" => $actor, "actor" => $actor,

View File

@ -51,10 +51,7 @@ class Activitypub_mention_tag extends Managed_DataObject
public static function mention_tag_to_array_from_values($href, $name) public static function mention_tag_to_array_from_values($href, $name)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
"type" => "Mention", "type" => "Mention",
"href" => $href, "href" => $href,
"name" => $name "name" => $name

View File

@ -72,10 +72,7 @@ class Activitypub_notice extends Managed_DataObject
$to[]= 'https://www.w3.org/ns/activitystreams#Public'; $to[]= 'https://www.w3.org/ns/activitystreams#Public';
$item = [ $item = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'id' => $notice->getUrl(), 'id' => $notice->getUrl(),
'type' => 'Note', 'type' => 'Note',
'published' => str_replace(' ', 'T', $notice->getCreated()).'Z', 'published' => str_replace(' ', 'T', $notice->getCreated()).'Z',

View File

@ -96,10 +96,7 @@ class Activitypub_profile extends Managed_DataObject
$public_key = $rsa->ensure_public_key($profile); $public_key = $rsa->ensure_public_key($profile);
unset($rsa); unset($rsa);
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1"
],
'id' => $uri, 'id' => $uri,
'type' => 'Person', 'type' => 'Person',
'following' => common_local_url('apActorFollowing', ['id' => $id]), 'following' => common_local_url('apActorFollowing', ['id' => $id]),

View File

@ -50,10 +50,7 @@ class Activitypub_reject extends Managed_DataObject
public static function reject_to_array($object) public static function reject_to_array($object)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
"type" => "Reject", "type" => "Reject",
"object" => $object "object" => $object
]; ];

View File

@ -50,10 +50,7 @@ class Activitypub_tag extends Managed_DataObject
public static function tag_to_array($tag) public static function tag_to_array($tag)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'name' => $tag, 'name' => $tag,
'url' => common_local_url('tag', ['tag' => $tag]) 'url' => common_local_url('tag', ['tag' => $tag])
]; ];

View File

@ -50,10 +50,7 @@ class Activitypub_undo extends Managed_DataObject
public static function undo_to_array($object) public static function undo_to_array($object)
{ {
$res = [ $res = [
'@context' => [ '@context' => 'https://www.w3.org/ns/activitystreams',
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'id' => $object['id'].'/undo', 'id' => $object['id'].'/undo',
'type' => 'Undo', 'type' => 'Undo',
'actor' => $object['actor'], 'actor' => $object['actor'],