mirror of https://gitlab.com/bashrc2/epicyon
Link to person options from likers screen
parent
07ef6e7c77
commit
101fe83251
8
cache.py
8
cache.py
|
@ -34,18 +34,18 @@ def _remove_person_from_cache(base_dir: str, person_url: str,
|
|||
|
||||
def check_for_changed_actor(session, base_dir: 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):
|
||||
"""Checks if the avatar url exists and if not then
|
||||
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
|
||||
post from them is sent
|
||||
"""
|
||||
if not session or not avatarUrl:
|
||||
if not session or not avatar_url:
|
||||
return
|
||||
if domain_full in avatarUrl:
|
||||
if domain_full in avatar_url:
|
||||
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
|
||||
_remove_person_from_cache(base_dir, person_url, person_cache)
|
||||
|
||||
|
|
|
@ -7427,8 +7427,12 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
page_number = 1
|
||||
options_list = options_str.split(';')
|
||||
options_actor = options_list[0]
|
||||
options_page_number = options_list[1]
|
||||
options_profile_url = options_list[2]
|
||||
options_page_number = 1
|
||||
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 \
|
||||
options_profile_url.startswith('/members/'):
|
||||
ext = options_profile_url.split('.')[-1]
|
||||
|
|
|
@ -15,6 +15,7 @@ from utils import get_display_name
|
|||
from utils import get_nickname_from_actor
|
||||
from utils import has_object_dict
|
||||
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_footer
|
||||
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)
|
||||
if 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 += \
|
||||
'<label class="likerNames">' + \
|
||||
'<a href="' + liker_actor + '">' + liker_name + '</a>' + \
|
||||
'<a href="' + liker_options_link + '">' + liker_name + '</a>' + \
|
||||
'</label>'
|
||||
html_str += '<center>\n' + likers_list + '\n</center>\n'
|
||||
|
||||
|
|
Loading…
Reference in New Issue