Show link to actor proxy protocol

merge-requests/30/head
Bob Mottram 2023-05-12 15:11:42 +01:00
parent b9c379e53f
commit cd92f73769
1 changed files with 18 additions and 2 deletions

View File

@ -517,7 +517,14 @@ def _get_profile_header(base_dir: str, http_prefix: str, nickname: str,
actor_proxied = ''
else:
actor_proxied = remove_html(actor_proxied)
if '/' in actor_proxied:
if '://' in actor_proxied:
proxy_str = 'Proxy'
if translate.get(proxy_str):
proxy_str = translate[proxy_str]
actor_proxied = '<a href="' + actor_proxied + \
'" target="_blank" rel="nofollow noopener noreferrer">' + \
proxy_str + '</a>'
elif '/' in actor_proxied:
actor_proxied = actor_proxied.split('/')[-1]
actor_proxied = ' [' + actor_proxied + ']'
@ -631,13 +638,22 @@ def _get_profile_header_after_search(nickname: str, default_timeline: str,
avatar_url + '" ' + 'alt="" class="title"></a>\n'
if not display_name:
display_name = search_nickname
if not actor_proxied:
actor_proxied = ''
else:
actor_proxied = remove_html(actor_proxied)
if '/' in actor_proxied:
if '://' in actor_proxied:
proxy_str = 'Proxy'
if translate.get(proxy_str):
proxy_str = translate[proxy_str]
actor_proxied = '<a href="' + actor_proxied + \
'" target="_blank" rel="nofollow noopener noreferrer">' + \
proxy_str + '</a>'
elif '/' in actor_proxied:
actor_proxied = actor_proxied.split('/')[-1]
actor_proxied = ' [' + actor_proxied + ']'
html_str += \
' <h1>\n' + \
' ' + display_name + '\n' + \