shares endpoints

merge-requests/30/head
Bob Mottram 2023-06-27 19:21:56 +01:00
parent f510470d07
commit 35fab69ccd
1 changed files with 10 additions and 0 deletions

View File

@ -434,6 +434,8 @@ def _create_person_base(base_dir: str, nickname: str, domain: str, port: int,
'endpoints': {
'id': person_id + '/endpoints',
'sharedInbox': http_prefix + '://' + domain + '/inbox',
'offers': person_id + '/offers',
'wanted': person_id + '/wanted'
},
'featured': person_id + '/collections/featured',
'featuredTags': person_id + '/collections/tags',
@ -802,6 +804,14 @@ def person_upgrade_actor(base_dir: str, person_json: {},
person_json['published'] = published
update_actor = True
if person_json.get('endpoints'):
if not person_json['endpoints'].get('offers'):
person_json['endpoints']['offers'] = person_json['id'] + '/offers'
update_actor = True
if not person_json['endpoints'].get('wanted'):
person_json['endpoints']['wanted'] = person_json['id'] + '/wanted'
update_actor = True
if person_json.get('shares'):
if person_json['shares'].endswith('/shares'):
person_json['shares'] = person_json['id'] + '/catalog'