mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
Deliver Actor 'summary' info as HTML
(same as Mastodon and Lemmy)
This commit is contained in:
parent
ec7f38f0cb
commit
37b06ef43f
1 changed files with 4 additions and 7 deletions
|
@ -282,12 +282,8 @@ def user_profile(actor):
|
|||
"type": "Image",
|
||||
"url": f"https://{current_app.config['SERVER_NAME']}{user.cover_image()}"
|
||||
}
|
||||
if user.about:
|
||||
actor_data['source'] = {
|
||||
"content": user.about,
|
||||
"mediaType": "text/markdown"
|
||||
}
|
||||
actor_data['summary'] = markdown_to_html(user.about)
|
||||
if user.about_html:
|
||||
actor_data['summary'] = user.about_html
|
||||
if user.matrix_user_id:
|
||||
actor_data['matrixUserId'] = user.matrix_user_id
|
||||
resp = jsonify(actor_data)
|
||||
|
@ -332,7 +328,6 @@ def community_profile(actor):
|
|||
"type": "Group",
|
||||
"id": f"https://{server}/c/{actor}",
|
||||
"name": community.title,
|
||||
"summary": community.description,
|
||||
"sensitive": True if community.nsfw or community.nsfl else False,
|
||||
"preferredUsername": actor,
|
||||
"inbox": f"https://{server}/c/{actor}/inbox",
|
||||
|
@ -356,6 +351,8 @@ def community_profile(actor):
|
|||
"published": ap_datetime(community.created_at),
|
||||
"updated": ap_datetime(community.last_active),
|
||||
}
|
||||
if community.description_html:
|
||||
actor_data["summary"] = community.description_html
|
||||
if community.icon_id is not None:
|
||||
actor_data["icon"] = {
|
||||
"type": "Image",
|
||||
|
|
Loading…
Add table
Reference in a new issue