mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-09 18:08:00 +00:00
add more info to actor endpoint
This commit is contained in:
parent
c41cd6e015
commit
ed066d94af
|
@ -192,14 +192,15 @@ class DotDict(dict):
|
||||||
|
|
||||||
class Message(DotDict):
|
class Message(DotDict):
|
||||||
@classmethod
|
@classmethod
|
||||||
def new_actor(cls, host, pubkey, description=None):
|
def new_actor(cls, host, pubkey, name=None, description=None, locked=False):
|
||||||
return cls({
|
return cls({
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
'id': f'https://{host}/actor',
|
'id': f'https://{host}/actor',
|
||||||
'type': 'Application',
|
'type': 'Application',
|
||||||
'preferredUsername': 'relay',
|
'preferredUsername': 'relay',
|
||||||
'name': 'ActivityRelay',
|
'name': name or 'ActivityRelay',
|
||||||
'summary': description or 'ActivityRelay bot',
|
'summary': description or 'ActivityRelay bot',
|
||||||
|
'manuallyApprovesFollowers': locked,
|
||||||
'followers': f'https://{host}/followers',
|
'followers': f'https://{host}/followers',
|
||||||
'following': f'https://{host}/following',
|
'following': f'https://{host}/following',
|
||||||
'inbox': f'https://{host}/inbox',
|
'inbox': f'https://{host}/inbox',
|
||||||
|
|
|
@ -68,10 +68,13 @@ a:hover {{ color: #8AF; }}
|
||||||
|
|
||||||
|
|
||||||
@register_route('GET', '/actor', '/inbox')
|
@register_route('GET', '/actor', '/inbox')
|
||||||
async def actor(request):
|
async def actor(request, s):
|
||||||
data = Message.new_actor(
|
data = Message.new_actor(
|
||||||
host = request.config.host,
|
host = request.config.host,
|
||||||
pubkey = request.app.signer.pubkey
|
pubkey = request.app.signer.pubkey,
|
||||||
|
name = s.get_config('name'),
|
||||||
|
description = s.get_config('description'),
|
||||||
|
locked = s.get_config('require_approval')
|
||||||
)
|
)
|
||||||
|
|
||||||
return Response.new(data, ctype='activity')
|
return Response.new(data, ctype='activity')
|
||||||
|
|
Loading…
Reference in a new issue