Move Follow to /contact namespace

This commit is contained in:
Philipp 2022-10-31 17:58:04 +01:00
parent 3554894577
commit b5d01337d9
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432
6 changed files with 8 additions and 8 deletions

View File

@ -62,7 +62,7 @@ class APContact
'addr' => $local_owner['addr'],
'baseurl' => $local_owner['baseurl'],
'url' => $local_owner['url'],
'subscribe' => $local_owner['baseurl'] . '/follow?url={uri}'];
'subscribe' => $local_owner['baseurl'] . '/contact/follow?url={uri}'];
if (!empty($local_owner['alias']) && ($local_owner['url'] != $local_owner['alias'])) {
$data['alias'] = $local_owner['alias'];

View File

@ -341,7 +341,7 @@ class Profile
if ($visitor_is_following) {
$unfollow_link = $visitor_base_path . '/contact/unfollow?url=' . urlencode($profile_url) . '&auto=1';
} else {
$follow_link = $visitor_base_path . '/follow?url=' . urlencode($profile_url) . '&auto=1';
$follow_link = $visitor_base_path .'/contact/follow?url=' . urlencode($profile_url) . '&auto=1';
}
}

View File

@ -202,7 +202,7 @@ class Follow extends BaseModule
protected function process(string $url)
{
$returnPath = 'follow?rul=' . urlencode($url);
$returnPath = 'follow?url=' . urlencode($url);
$result = Contact::createFromProbeForUser($this->app->getLoggedInUserId(), $url);

View File

@ -122,7 +122,7 @@ class Xrd extends BaseModule
],
[
'rel' => 'http://ostatus.org/schema/1.0/subscribe',
'template' => $baseURL . '/follow?url={uri}',
'template' => $baseURL . '/contact/follow?url={uri}',
],
[
'rel' => ActivityNamespace::FEED,
@ -212,7 +212,7 @@ class Xrd extends BaseModule
],
[
'rel' => 'http://ostatus.org/schema/1.0/subscribe',
'template' => $baseURL . '/follow?url={uri}',
'template' => $baseURL . '/contact/follow?url={uri}',
],
[
'rel' => 'magic-public-key',
@ -312,7 +312,7 @@ class Xrd extends BaseModule
'11:link' => [
'@attributes' => [
'rel' => 'http://ostatus.org/schema/1.0/subscribe',
'template' => $baseURL . '/follow?url={uri}'
'template' => $baseURL . '/contact/follow?url={uri}'
]
],
'12:link' => [

View File

@ -2185,7 +2185,7 @@ class Probe
'xmpp' => $owner['xmpp'], 'matrix' => $owner['matrix'],
'hide' => !$owner['net-publish'], 'batch' => '', 'notify' => $owner['notify'],
'poll' => $owner['poll'], 'request' => $owner['request'], 'confirm' => $owner['confirm'],
'subscribe' => $approfile['generator']['url'] . '/follow?url={uri}', 'poco' => $owner['poco'],
'subscribe' => $approfile['generator']['url'] . '/contact/follow?url={uri}', 'poco' => $owner['poco'],
'following' => $approfile['following'], 'followers' => $approfile['followers'],
'inbox' => $approfile['inbox'], 'outbox' => $approfile['outbox'],
'sharedinbox' => $approfile['endpoints']['sharedInbox'], 'network' => Protocol::DFRN,

View File

@ -387,6 +387,7 @@ return [
'/hidden' => [Module\Contact::class, [R::GET]],
'/ignored' => [Module\Contact::class, [R::GET]],
'/hovercard' => [Module\Contact\Hovercard::class, [R::GET]],
'/follow[/{url}]' => [Module\Contact\Follow::class, [R::GET, R::POST]],
'/unfollow' => [Module\Contact\Unfollow::class, [R::GET, R::POST]],
],
@ -418,7 +419,6 @@ return [
'/filed' => [Module\Search\Filed::class, [R::GET]],
'/filer[/{id:\d+}]' => [Module\Filer\SaveTag::class, [R::GET]],
'/filerm/{id:\d+}' => [Module\Filer\RemoveTag::class, [R::GET, R::POST]],
'/follow[/{url}]' => [Module\Contact\Follow::class, [R::GET, R::POST]],
'/follow_confirm' => [Module\FollowConfirm::class, [R::GET, R::POST]],
'/followers/{nickname}' => [Module\ActivityPub\Followers::class, [R::GET]],
'/following/{nickname}' => [Module\ActivityPub\Following::class, [R::GET]],