mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
post_to_page: use post.community instead of also passing community
This commit is contained in:
parent
f6f7af0a1e
commit
c5596e2f08
2 changed files with 4 additions and 4 deletions
|
@ -1244,7 +1244,7 @@ def community_featured(actor):
|
|||
}
|
||||
|
||||
for post in posts:
|
||||
community_data['orderedItems'].append(post_to_page(post, community))
|
||||
community_data['orderedItems'].append(post_to_page(post))
|
||||
|
||||
return jsonify(community_data)
|
||||
|
||||
|
|
|
@ -202,13 +202,13 @@ def post_to_activity(post: Post, community: Community):
|
|||
return activity_data
|
||||
|
||||
|
||||
def post_to_page(post: Post, community: Community):
|
||||
def post_to_page(post: Post):
|
||||
activity_data = {
|
||||
"type": "Page",
|
||||
"id": post.ap_id,
|
||||
"attributedTo": post.author.ap_public_url,
|
||||
"to": [
|
||||
f"https://{current_app.config['SERVER_NAME']}/c/{community.name}",
|
||||
f"https://{current_app.config['SERVER_NAME']}/c/{post.community.name}",
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"name": post.title,
|
||||
|
@ -220,7 +220,7 @@ def post_to_page(post: Post, community: Community):
|
|||
"sensitive": post.nsfw or post.nsfl,
|
||||
"published": ap_datetime(post.created_at),
|
||||
"stickied": post.sticky,
|
||||
"audience": f"https://{current_app.config['SERVER_NAME']}/c/{community.name}",
|
||||
"audience": f"https://{current_app.config['SERVER_NAME']}/c/{post.community.name}",
|
||||
"tag": post.tags_for_activitypub(),
|
||||
'language': {
|
||||
'identifier': post.language_code(),
|
||||
|
|
Loading…
Add table
Reference in a new issue