merge-requests/30/head
Bob Mottram 2022-12-26 23:17:01 +00:00
commit 2454b6a9a1
4 changed files with 24 additions and 16 deletions

View File

@ -32,6 +32,7 @@ from webfinger import webfinger_handle
from httpsig import create_signed_header
from siteactive import site_is_active
from languages import understood_post_language
from utils import contains_invalid_actor_url_chars
from utils import acct_handle_dir
from utils import is_dm
from utils import remove_eol
@ -233,8 +234,12 @@ def get_user_url(wf_request: {}, source_id: int, debug: bool) -> str:
'contains single user instance actor ' +
str(source_id) + ' ' + str(link))
else:
return link['href'].replace('/@', '/users/')
return link['href']
url = link['href'].replace('/@', '/users/')
if not contains_invalid_actor_url_chars(url):
return url
url = link['href']
if not contains_invalid_actor_url_chars(url):
return url
return None

View File

@ -1,7 +1,6 @@
____ _________ __ _____ ___ ____
/ _]| \ | / ]| | | / \ | \
| [_ | o ) | / / | | || || _ |
| _]| _/| |/ / | ~ || O || | |
| [_ | | | / \_ |___, || || | |
| || | | \ || || || | |
|_____||__| |____\____||____/ \___/ |__|__|
███████╗██████╗░██╗░█████╗░██╗░░░██╗░█████╗░███╗░░██╗
██╔════╝██╔══██╗██║██╔══██╗╚██╗░██╔╝██╔══██╗████╗░██║
█████╗░░██████╔╝██║██║░░╚═╝░╚████╔╝░██║░░██║██╔██╗██║
██╔══╝░░██╔═══╝░██║██║░░██╗░░╚██╔╝░░██║░░██║██║╚████║
███████╗██║░░░░░██║╚█████╔╝░░░██║░░░╚█████╔╝██║░╚███║
╚══════╝╚═╝░░░░░╚═╝░╚════╝░░░░╚═╝░░░░╚════╝░╚═╝░░╚══╝

View File

@ -41,8 +41,8 @@ INVALID_CHARACTERS = (
INVALID_ACTOR_URL_CHARACTERS = (
'', '', '<', '>', '%', '{', '}', '|', '\\', '^', '`',
'?', '#', '[', ']', '@', '!', '$', '&', "'", '(', ')',
'*', '+', ',', ';', '='
'?', '#', '[', ']', '!', '$', '&', "'", '(', ')', '*',
'+', ',', ';', '='
)

View File

@ -951,6 +951,7 @@ def html_timeline(default_timeline: str,
last_post_id = ''
last_item_str = ''
if timeline_json:
# if this is the media timeline then add an extra gallery container
if box_name == 'tlmedia':
@ -1032,20 +1033,19 @@ def html_timeline(default_timeline: str,
if curr_tl_str:
if curr_tl_str not in tl_items_str:
last_item_str = text_mode_separator + curr_tl_str
last_post_id = \
remove_id_ending(item['id']).replace('/', '#')
item_ctr += 1
if not reverse_sequence:
tl_items_str += text_mode_separator + curr_tl_str
tl_items_str += last_item_str
if separator_str:
tl_items_str += separator_str
else:
tl_items_str = \
text_mode_separator + curr_tl_str + \
tl_items_str
tl_items_str = last_item_str + tl_items_str
if separator_str:
tl_items_str = \
text_mode_separator + curr_tl_str + \
last_item_str + \
separator_str + tl_items_str
tl_str += tl_items_str
@ -1058,6 +1058,10 @@ def html_timeline(default_timeline: str,
# page down arrow
if item_ctr > 0:
# if showing the page down icon then remove the last item so that
# firstpost does not overlap on the next timeline
if last_item_str:
tl_str = tl_str.replace(last_item_str, '')
tl_str += text_mode_separator
first_post = ''
if last_post_id: