Fix last merge issues

This commit is contained in:
Diogo Cordeiro 2018-07-10 01:47:52 +01:00
parent ecb812d5e6
commit 295d4a254d
19 changed files with 226 additions and 189 deletions

View File

@ -26,7 +26,7 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**
@ -90,6 +90,32 @@ class ActivityPubPlugin extends Plugin
} }
} }
/**
* Overwrites variables in URL-mapping
*/
class ActivityPubURLMapperOverwrite extends URLMapper
{
static function overwrite_variable ($m, $path, $args, $paramPatterns, $newaction) {
$mimes = [
'application/activity+json',
'application/ld+json',
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
];
if (in_array ($_SERVER["HTTP_ACCEPT"], $mimes) == false) {
return true;
}
$m->connect ($path, array('action' => $newaction), $paramPatterns);
$regex = self::makeRegex($path, $paramPatterns);
foreach ($m->variables as $n => $v) {
if ($v[1] == $regex) {
$m->variables[$n][0]['action'] = $newaction;
}
}
}
}
/** /**
* Plugin return handler * Plugin return handler
*/ */

View File

@ -26,14 +26,13 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**
* @category Plugin * @category Plugin
* @package GNUsocial * @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @author Daniel Supernault <danielsupernault@gmail.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://www.gnu.org/software/social/ * @link http://www.gnu.org/software/social/
*/ */

View File

@ -26,14 +26,13 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**
* @category Plugin * @category Plugin
* @package GNUsocial * @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @author Daniel Supernault <danielsupernault@gmail.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://www.gnu.org/software/social/ * @link http://www.gnu.org/software/social/
*/ */

View File

@ -1,13 +1,8 @@
<?php <?php
require_once dirname (__DIR__) . DIRECTORY_SEPARATOR . "utils" . DIRECTORY_SEPARATOR . "discovery.php";
use Activitypub_Discovery;
/** /**
* GNU social - a federating social network * GNU social - a federating social network
* *
* Todo: Description * ActivityPubPlugin implementation for GNU Social
*
* PHP version 5
* *
* LICENCE: This program is free software: you can redistribute it and/or modify * LICENCE: This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
@ -26,80 +21,93 @@ use Activitypub_Discovery;
* @package GNUsocial * @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @author Daniel Supernault <danielsupernault@gmail.com> * @author Daniel Supernault <danielsupernault@gmail.com>
* @copyright 2015 Free Software Foundaction, Inc. * @copyright 2018 Free Software Foundation http://fsf.org
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link https://gnu.io/social * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) {
exit (1);
}
if (!defined('GNUSOCIAL')) { exit(1); } /**
* @category Plugin
* @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://www.gnu.org/software/social/
*/
class apActorInboxAction extends ManagedAction class apActorInboxAction extends ManagedAction
{ {
protected $needLogin = false; protected $needLogin = false;
protected $canPost = true; protected $canPost = true;
protected function handle () /**
{ * Handle the Actor Inbox request
$nickname = $this->trimmed ('nickname'); *
try { * @return void
$user = User::getByNickname ($nickname); */
$profile = $user->getProfile (); protected function handle ()
$url = $profile->profileurl; {
} catch (Exception $e) { $nickname = $this->trimmed ('nickname');
ActivityPubReturn::error ("Invalid username."); try {
} $user = User::getByNickname ($nickname);
$profile = $user->getProfile ();
$url = $profile->profileurl;
} catch (Exception $e) {
ActivityPubReturn::error ("Invalid username.");
}
if ($_SERVER['REQUEST_METHOD'] !== 'POST') { if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
ActivityPubReturn::error ("C2S not implemented just yet."); ActivityPubReturn::error ("C2S not implemented just yet.");
} }
$data = json_decode (file_get_contents ('php://input')); $data = json_decode (file_get_contents ('php://input'));
// Validate data // Validate data
if (!(isset($data->type))) { if (!(isset($data->type))) {
ActivityPubReturn::error ("Type was not specified."); ActivityPubReturn::error ("Type was not specified.");
} }
if (!isset($data->actor)) { if (!isset($data->actor)) {
ActivityPubReturn::error ("Actor was not specified."); ActivityPubReturn::error ("Actor was not specified.");
} }
if (!isset($data->object)) { if (!isset($data->object)) {
ActivityPubReturn::error ("Object was not specified."); ActivityPubReturn::error ("Object was not specified.");
} }
// Get valid Actor object // Get valid Actor object
try { try {
require_once dirname (__DIR__) . DIRECTORY_SEPARATOR . "utils" . DIRECTORY_SEPARATOR . "discovery.php"; require_once dirname (__DIR__) . DIRECTORY_SEPARATOR . "utils" . DIRECTORY_SEPARATOR . "discovery.php";
$actor_profile = new Activitypub_Discovery; $actor_profile = new Activitypub_Discovery;
$actor_profile = $actor_profile->lookup($data->actor); $actor_profile = $actor_profile->lookup ($data->actor);
$actor_profile = $actor_profile[0]; $actor_profile = $actor_profile[0];
} catch (Exception $e) { } catch (Exception $e) {
ActivityPubReturn::error ("Invalid Actor.", 404); ActivityPubReturn::error ("Invalid Actor.", 404);
} }
$to_profiles = array ($user); $to_profiles = array ($user);
// Process request // Process request
switch ($data->type) { switch ($data->type) {
case "Create": case "Create":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Create.php"; require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Create.php";
break; break;
case "Delete": case "Delete":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Delete.php"; require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Delete.php";
break; break;
case "Follow": case "Follow":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Follow.php"; require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Follow.php";
break; break;
case "Like": case "Like":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Like.php"; require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Like.php";
break; break;
case "Undo": case "Undo":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Undo.php"; require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Undo.php";
break; break;
case "Announce": case "Announce":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Announce.php"; require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Announce.php";
break; break;
default: default:
ActivityPubReturn::error ("Invalid type value."); ActivityPubReturn::error ("Invalid type value.");
}
} }
}
} }

View File

@ -26,14 +26,13 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**
* @category Plugin * @category Plugin
* @package GNUsocial * @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @author Daniel Supernault <danielsupernault@gmail.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://www.gnu.org/software/social/ * @link http://www.gnu.org/software/social/
*/ */

View File

@ -26,7 +26,7 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**

View File

@ -1,4 +1,5 @@
<?php <?php
require_once dirname (__DIR__) . DIRECTORY_SEPARATOR . "utils" . DIRECTORY_SEPARATOR . "discovery.php"; require_once dirname (__DIR__) . DIRECTORY_SEPARATOR . "utils" . DIRECTORY_SEPARATOR . "discovery.php";
use Activitypub_Discovery; use Activitypub_Discovery;
use ActivityPubReturn; use ActivityPubReturn;
@ -7,9 +8,7 @@ use Activitypub_notice;
/** /**
* GNU social - a federating social network * GNU social - a federating social network
* *
* Todo: Description * ActivityPubPlugin implementation for GNU Social
*
* PHP version 5
* *
* LICENCE: This program is free software: you can redistribute it and/or modify * LICENCE: This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by * it under the terms of the GNU Affero General Public License as published by
@ -28,95 +27,107 @@ use Activitypub_notice;
* @package GNUsocial * @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @author Daniel Supernault <danielsupernault@gmail.com> * @author Daniel Supernault <danielsupernault@gmail.com>
* @copyright 2015 Free Software Foundaction, Inc. * @copyright 2018 Free Software Foundation http://fsf.org
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link https://gnu.io/social * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) {
exit (1);
}
if (!defined('GNUSOCIAL')) { exit(1); } /**
* @category Plugin
* @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://www.gnu.org/software/social/
*/
class apSharedInboxAction extends ManagedAction class apSharedInboxAction extends ManagedAction
{ {
protected $needLogin = false; protected $needLogin = false;
protected $canPost = true; protected $canPost = true;
protected function handle () /**
{ * Handle the Shared Inbox request
if ($_SERVER['REQUEST_METHOD'] !== 'POST') { *
ActivityPubReturn::error ("Only POST requests allowed."); * @return void
} */
protected function handle ()
$data = json_decode (file_get_contents ('php://input')); {
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
// Validate data ActivityPubReturn::error ("Only POST requests allowed.");
if (!(isset($data->type))) {
ActivityPubReturn::error ("Type was not specified.");
}
if (!isset($data->actor)) {
ActivityPubReturn::error ("Actor was not specified.");
}
if (!isset($data->to)) {
ActivityPubReturn::error ("To was not specified.");
}
if (!isset($data->object)) {
ActivityPubReturn::error ("Object was not specified.");
}
$discovery = new Activitypub_Discovery;
// Get valid Actor object
try {
$actor_profile = $discovery->lookup ($data->actor);
$actor_profile = $actor_profile[0];
} catch (Exception $e) {
ActivityPubReturn::error ("Invalid Actor.", 404);
}
// Public To:
$public_to = array ("https://www.w3.org/ns/activitystreams#Public",
"Public",
"as:Public");
$to_profiles = array ();
// Generate To objects
if (is_array ($data->to)) {
// Remove duplicates from To actors set
array_unique ($data->to);
foreach ($data->to as $to_url) {
try {
$to_profiles = array_merge ($to_profiles, $discovery->lookup ($to_url));
} catch (Exception $e) {
// XXX: Invalid actor found, not sure how we handle those
} }
}
} else if (empty ($data->to)
|| in_array ($data->to, $public_to)) {
// No need to do anything else at this point, let's just break out the if
} else {
try {
$to_profiles[]= $discovery->lookup ($data->to);
} catch (Exception $e) {
ActivityPubReturn::error ("Invalid Actor.", 404);
}
}
unset ($discovery);
// Process request $data = json_decode (file_get_contents ('php://input'));
switch ($data->type) {
case "Create": // Validate data
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Create.php"; if (!isset($data->type)) {
break; ActivityPubReturn::error ("Type was not specified.");
case "Follow": }
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Follow.php"; if (!isset($data->actor)) {
break; ActivityPubReturn::error ("Actor was not specified.");
case "Like": }
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Like.php"; if (!isset($data->to)) {
break; ActivityPubReturn::error ("To was not specified.");
case "Announce": }
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Announce.php"; if (!isset($data->object)) {
break; ActivityPubReturn::error ("Object was not specified.");
default: }
ActivityPubReturn::error ("Invalid type value.");
} $discovery = new Activitypub_Discovery;
// Get valid Actor object
try {
$actor_profile = $discovery->lookup ($data->actor);
$actor_profile = $actor_profile[0];
} catch (Exception $e) {
ActivityPubReturn::error ("Invalid Actor.", 404);
}
// Public To:
$public_to = array ("https://www.w3.org/ns/activitystreams#Public",
"Public",
"as:Public");
$to_profiles = array ();
// Generate To objects
if (is_array ($data->to)) {
// Remove duplicates from To actors set
array_unique ($data->to);
foreach ($data->to as $to_url) {
try {
$to_profiles = array_merge ($to_profiles, $discovery->lookup ($to_url));
} catch (Exception $e) {
// XXX: Invalid actor found, not sure how we handle those
}
}
} else if (empty ($data->to) || in_array ($data->to, $public_to)) {
// No need to do anything else at this point, let's just break out the if
} else {
try {
$to_profiles[]= $discovery->lookup ($data->to);
} catch (Exception $e) {
ActivityPubReturn::error ("Invalid Actor.", 404);
}
}
unset ($discovery);
// Process request
switch ($data->type) {
case "Create":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Create.php";
break;
case "Follow":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Follow.php";
break;
case "Like":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Like.php";
break;
case "Announce":
require_once __DIR__ . DIRECTORY_SEPARATOR . "inbox" . DIRECTORY_SEPARATOR . "Announce.php";
break;
default:
ActivityPubReturn::error ("Invalid type value.");
}
} }
} }

View File

@ -26,7 +26,7 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
try { try {

View File

@ -26,7 +26,7 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
$valid_object_types = array ("Note"); $valid_object_types = array ("Note");
@ -70,7 +70,7 @@ if (Notice::contentTooLong ($content)) {
ActivityPubReturn::error ("That's too long. Maximum notice size is %d character."); ActivityPubReturn::error ("That's too long. Maximum notice size is %d character.");
} }
$options = array('source' = >'web', 'uri' = >$data->id); $options = array ('source' => 'web', 'uri' => $data->id);
// $options gets filled with possible scoping settings // $options gets filled with possible scoping settings
ToSelector::fillActivity ($this, $act, $options); ToSelector::fillActivity ($this, $act, $options);

View File

@ -26,12 +26,12 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
try { try {
Activitypub_notice::getByUri ($data->object)->deleteAs ($actor_profile); Activitypub_notice::getByUri ($data->object)->deleteAs ($actor_profile);
ActivityPubReturn::answer ("Notice deleted successfully."); ActivityPubReturn::answer ("Notice deleted successfully.");
} catch(Exception $ex) { } catch(Exception $ex) {
ActivityPubReturn::error ($ex->getMessage(), 403); ActivityPubReturn::error ($ex->getMessage (), 403);
} }

View File

@ -26,7 +26,7 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
// Get valid Object profile // Get valid Object profile
@ -44,6 +44,6 @@ try {
} else { } else {
ActivityPubReturn::error ("Already following.", 409); ActivityPubReturn::error ("Already following.", 409);
} }
} catch(Exception $ex) { } catch (Exception $ex) {
ActivityPubReturn::error ("Invalid Object Actor URL.", 404); ActivityPubReturn::error ("Invalid Object Actor URL.", 404);
} }

View File

@ -26,7 +26,7 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
try { try {

View File

@ -29,7 +29,7 @@ use Activitypub_Discovery;
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
// Validate data // Validate data

View File

@ -26,14 +26,13 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**
* @category Plugin * @category Plugin
* @package GNUsocial * @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @author Daniel Supernault <danielsupernault@gmail.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://www.gnu.org/software/social/ * @link http://www.gnu.org/software/social/
*/ */

View File

@ -26,14 +26,13 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**
* @category Plugin * @category Plugin
* @package GNUsocial * @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @author Daniel Supernault <danielsupernault@gmail.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://www.gnu.org/software/social/ * @link http://www.gnu.org/software/social/
*/ */

View File

@ -26,7 +26,7 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**
@ -45,22 +45,22 @@ class Activitypub_notice extends Managed_DataObject
* @param \Notice $notice * @param \Notice $notice
* @return pretty array to be used in a response * @return pretty array to be used in a response
*/ */
public static function noticeToObject($notice) { public static function noticeToObject ($notice) {
$attachments = array (); $attachments = array ();
foreach($notice->attachments()as $attachment) { foreach($notice->attachments () as $attachment) {
$attachments[] = Activitypub_attachment::attachmentToObject ($attachment); $attachments[] = Activitypub_attachment::attachmentToObject ($attachment);
} }
$tags = array (); $tags = array ();
foreach($notice->getTags()as $tag) { foreach($notice->getTags()as $tag) {
if ($tag != "") { // Hacky workaround to avoid stupid outputs if ($tag != "") { // Hacky workaround to avoid stupid outputs
$tags[] = Activitypub_tag::tagNameToObject($tag); $tags[] = Activitypub_tag::tagNameToObject ($tag);
} }
} }
$to = array (); $to = array ();
foreach ($notice->getAttentionProfileIDs()as $to_id) { foreach ($notice->getAttentionProfileIDs () as $to_id) {
$to[] = Profile::getById($to_id)->getUri(); $to[] = Profile::getById ($to_id)->getUri ();
} }
if (!is_null($to)) { if (!is_null($to)) {
$to = array ("https://www.w3.org/ns/activitystreams#Public"); $to = array ("https://www.w3.org/ns/activitystreams#Public");

View File

@ -26,7 +26,7 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**

View File

@ -26,14 +26,13 @@
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**
* @category Plugin * @category Plugin
* @package GNUsocial * @package GNUsocial
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @author Daniel Supernault <danielsupernault@gmail.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://www.gnu.org/software/social/ * @link http://www.gnu.org/software/social/
*/ */
@ -54,7 +53,7 @@ class Activitypub_tag extends Managed_DataObject
] ]
], ],
'name' => $tag, 'name' => $tag,
'url' => common_local_url('tag', array('tag' => $tag)) 'url' => common_local_url ('tag', array('tag' => $tag))
]; ];
return $res; return $res;

View File

@ -22,25 +22,23 @@ use Profile;
* *
* @category Plugin * @category Plugin
* @package GNUsocial * @package GNUsocial
* @author Daniel Supernault <danielsupernault@gmail.com>
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @author Daniel Supernault <danielsupernault@gmail.com>
* @copyright 2018 Free Software Foundation http://fsf.org * @copyright 2018 Free Software Foundation http://fsf.org
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link https://www.gnu.org/software/social/ * @link https://www.gnu.org/software/social/
*/ */
if (!defined ('GNUSOCIAL')) { if (!defined ('GNUSOCIAL')) {
exit(1); exit (1);
} }
/** /**
* @category Plugin * @category Plugin
* @package GNUsocial * @package GNUsocial
* @author Daniel Supernault <danielsupernault@gmail.com>
* @author Diogo Cordeiro <diogo@fc.up.pt> * @author Diogo Cordeiro <diogo@fc.up.pt>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://www.gnu.org/software/social/ * @link http://www.gnu.org/software/social/
*/ */
class Activitypub_Discovery class Activitypub_Discovery
{ {
private $discovered_actor_profiles = array (); private $discovered_actor_profiles = array ();