This commit is contained in:
rimu 2024-06-05 20:32:25 +12:00
parent a5583dc37e
commit bd248605d6

View file

@ -880,9 +880,9 @@ def federate_post(community, post):
page = { page = {
'type': 'Page', 'type': 'Page',
'id': post.ap_id, 'id': post.ap_id,
'attributedTo': current_user.ap_profile_id, 'attributedTo': current_user.public_url(),
'to': [ 'to': [
community.ap_profile_id, community.public_url(),
'https://www.w3.org/ns/activitystreams#Public' 'https://www.w3.org/ns/activitystreams#Public'
], ],
'name': post.title, 'name': post.title,
@ -895,7 +895,7 @@ def federate_post(community, post):
'nsfl': post.nsfl, 'nsfl': post.nsfl,
'stickied': post.sticky, 'stickied': post.sticky,
'published': ap_datetime(utcnow()), 'published': ap_datetime(utcnow()),
'audience': community.ap_profile_id, 'audience': community.public_url(),
'language': { 'language': {
'identifier': post.language_code(), 'identifier': post.language_code(),
'name': post.language_name() 'name': post.language_name()
@ -904,15 +904,15 @@ def federate_post(community, post):
} }
create = { create = {
"id": f"https://{current_app.config['SERVER_NAME']}/activities/create/{gibberish(15)}", "id": f"https://{current_app.config['SERVER_NAME']}/activities/create/{gibberish(15)}",
"actor": current_user.ap_profile_id, "actor": current_user.public_url(),
"to": [ "to": [
"https://www.w3.org/ns/activitystreams#Public" "https://www.w3.org/ns/activitystreams#Public"
], ],
"cc": [ "cc": [
community.ap_profile_id community.public_url()
], ],
"type": "Create", "type": "Create",
"audience": community.ap_profile_id, "audience": community.public_url(),
"object": page, "object": page,
'@context': default_context() '@context': default_context()
} }
@ -964,7 +964,7 @@ def federate_post(community, post):
"to": [ "to": [
"https://www.w3.org/ns/activitystreams#Public" "https://www.w3.org/ns/activitystreams#Public"
], ],
"actor": community.ap_profile_id, "actor": community.public_url(),
"cc": [ "cc": [
community.ap_followers_url community.ap_followers_url
], ],