Link to person options from likers screen

merge-requests/30/head
Bob Mottram 2022-03-02 12:01:05 +00:00
parent 07ef6e7c77
commit 101fe83251
3 changed files with 18 additions and 7 deletions

View File

@ -34,18 +34,18 @@ def _remove_person_from_cache(base_dir: str, person_url: str,
def check_for_changed_actor(session, base_dir: str, def check_for_changed_actor(session, base_dir: str,
http_prefix: str, domain_full: str, http_prefix: str, domain_full: str,
person_url: str, avatarUrl: str, person_cache: {}, person_url: str, avatar_url: str, person_cache: {},
timeout_sec: int): timeout_sec: int):
"""Checks if the avatar url exists and if not then """Checks if the avatar url exists and if not then
the actor has probably changed without receiving an actor/Person Update. the actor has probably changed without receiving an actor/Person Update.
So clear the actor from the cache and it will be refreshed when the next So clear the actor from the cache and it will be refreshed when the next
post from them is sent post from them is sent
""" """
if not session or not avatarUrl: if not session or not avatar_url:
return return
if domain_full in avatarUrl: if domain_full in avatar_url:
return return
if url_exists(session, avatarUrl, timeout_sec, http_prefix, domain_full): if url_exists(session, avatar_url, timeout_sec, http_prefix, domain_full):
return return
_remove_person_from_cache(base_dir, person_url, person_cache) _remove_person_from_cache(base_dir, person_url, person_cache)

View File

@ -7427,8 +7427,12 @@ class PubServer(BaseHTTPRequestHandler):
page_number = 1 page_number = 1
options_list = options_str.split(';') options_list = options_str.split(';')
options_actor = options_list[0] options_actor = options_list[0]
options_page_number = options_list[1] options_page_number = 1
options_profile_url = options_list[2] if len(options_list) > 1:
options_page_number = options_list[1]
options_profile_url = ''
if len(options_list) > 2:
options_profile_url = options_list[2]
if '.' in options_profile_url and \ if '.' in options_profile_url and \
options_profile_url.startswith('/members/'): options_profile_url.startswith('/members/'):
ext = options_profile_url.split('.')[-1] ext = options_profile_url.split('.')[-1]

View File

@ -15,6 +15,7 @@ from utils import get_display_name
from utils import get_nickname_from_actor from utils import get_nickname_from_actor
from utils import has_object_dict from utils import has_object_dict
from utils import load_json from utils import load_json
from person import get_person_avatar_url
from webapp_utils import html_header_with_external_style from webapp_utils import html_header_with_external_style
from webapp_utils import html_footer from webapp_utils import html_footer
from webapp_utils import get_banner_file from webapp_utils import get_banner_file
@ -134,9 +135,15 @@ def html_likers_of_post(base_dir: str, nickname: str,
liker_name = get_nickname_from_actor(liker_actor) liker_name = get_nickname_from_actor(liker_actor)
if likers_list: if likers_list:
likers_list += ' ' likers_list += ' '
liker_avatar_url = \
get_person_avatar_url(base_dir, liker_actor,
person_cache, False)
liker_options_link = \
'/users/' + nickname + '?options=' + \
liker_actor + ';1;' + liker_avatar_url
likers_list += \ likers_list += \
'<label class="likerNames">' + \ '<label class="likerNames">' + \
'<a href="' + liker_actor + '">' + liker_name + '</a>' + \ '<a href="' + liker_options_link + '">' + liker_name + '</a>' + \
'</label>' '</label>'
html_str += '<center>\n' + likers_list + '\n</center>\n' html_str += '<center>\n' + likers_list + '\n</center>\n'