Add new OStatus\PortableContacts module class

- Retain existing route /poco for backward compatibility
- Remove unsupported links to /poco/{nickname} route
This commit is contained in:
Hypolite Petovan 2022-11-10 22:28:33 -05:00
parent d21da2dc0a
commit eb6b03b555
5 changed files with 288 additions and 23 deletions

View file

@ -184,10 +184,6 @@ class Xrd extends BaseModule
'type' => 'text/html',
'href' => $baseURL . '/hcard/' . $owner['nickname'],
],
[
'rel' => ActivityNamespace::POCO,
'href' => $owner['poco'],
],
[
'rel' => 'http://webfinger.net/rel/avatar',
'type' => $avatar['type'],
@ -272,56 +268,50 @@ class Xrd extends BaseModule
]
],
'5:link' => [
'@attributes' => [
'rel' => 'http://portablecontacts.net/spec/1.0',
'href' => $owner['poco']
]
],
'6:link' => [
'@attributes' => [
'rel' => 'http://webfinger.net/rel/avatar',
'type' => $avatar['type'],
'href' => User::getAvatarUrl($owner)
]
],
'7:link' => [
'6:link' => [
'@attributes' => [
'rel' => 'http://joindiaspora.com/seed_location',
'type' => 'text/html',
'href' => $baseURL
]
],
'8:link' => [
'7:link' => [
'@attributes' => [
'rel' => 'salmon',
'href' => $baseURL . '/salmon/' . $owner['nickname']
]
],
'9:link' => [
'8:link' => [
'@attributes' => [
'rel' => 'http://salmon-protocol.org/ns/salmon-replies',
'href' => $baseURL . '/salmon/' . $owner['nickname']
]
],
'10:link' => [
'9:link' => [
'@attributes' => [
'rel' => 'http://salmon-protocol.org/ns/salmon-mention',
'href' => $baseURL . '/salmon/' . $owner['nickname'] . '/mention'
]
],
'11:link' => [
'10:link' => [
'@attributes' => [
'rel' => 'http://ostatus.org/schema/1.0/subscribe',
'template' => $baseURL . '/contact/follow?url={uri}'
]
],
'12:link' => [
'11:link' => [
'@attributes' => [
'rel' => 'magic-public-key',
'href' => 'data:application/magic-public-key,' . Salmon::salmonKey($owner['spubkey'])
]
],
'13:link' => [
'12:link' => [
'@attributes' => [
'rel' => 'http://purl.org/openwebauth/v1',
'type' => 'application/x-zot+json',