From cc40ad2a40fac70cbd4ba64ac50e524f3095188f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 24 Aug 2023 11:38:53 +0100 Subject: [PATCH] Show attached shared items on profile after search --- webapp_profile.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/webapp_profile.py b/webapp_profile.py index e5af497d4..a456886cc 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -255,6 +255,10 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int, if profile_json['type'] == 'Group': is_group = True + # shared items attached to the actor + # https://codeberg.org/fediverse/fep/src/branch/main/fep/0837/fep-0837.md + attached_shared_items = actor_attached_shares_as_html(profile_json) + avatar_url = '' if profile_json.get('icon'): if profile_json['icon'].get('url'): @@ -361,7 +365,8 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int, avatar_url, image_url, moved_to, profile_json['id'], also_known_as, access_keys, - joined_date, actor_proxied) + joined_date, actor_proxied, + attached_shared_items) domain_full = get_full_domain(domain, port) @@ -666,7 +671,8 @@ def _get_profile_header_after_search(nickname: str, default_timeline: str, also_known_as: [], access_keys: {}, joined_date: str, - actor_proxied: str) -> str: + actor_proxied: str, + attached_shared_items: str) -> str: """The header of a searched for handle, containing background image and avatar """ @@ -763,6 +769,10 @@ def _get_profile_header_after_search(nickname: str, default_timeline: str, featured_hashtags + \ ' \n' + \ ' \n\n' + if attached_shared_items: + html_str += \ + '

' + translate['Shares'] + ':
\n' + \ + attached_shared_items + '

\n' return html_str