Indicate blocked account on person options

main
Bob Mottram 2023-08-29 18:52:35 +01:00
parent 1bea706c5a
commit 3b632976af
3 changed files with 13 additions and 2 deletions

View File

@ -234,7 +234,7 @@ def html_confirm_follow(translate: {}, base_dir: str,
send_block_filename = \
acct_dir(base_dir, nickname, domain) + '/send_blocks.txt'
if os.path.isfile(send_block_filename):
if text_in_file('://' + follow_domain,
if text_in_file('://' + follow_domain + '\n',
send_block_filename, False):
follow_str += \
' <p class="followText"><b>' + \

View File

@ -294,6 +294,17 @@ def html_person_options(default_timeline: str,
options_str += \
' <p class="optionsText">' + translate['Options for'] + \
' @' + handle_shown + '</p>\n'
# is sending posts to this account blocked?
send_block_filename = \
acct_dir(base_dir, nickname, domain) + '/send_blocks.txt'
if os.path.isfile(send_block_filename):
if text_in_file(options_actor,
send_block_filename, False):
options_str += \
' <p class="optionsText"><b>' + \
translate['FollowAccountWarning'] + '</b></p>\n'
if follows_you and authorized:
options_str += \
' <p class="optionsText">' + translate['Follows you'] + '</p>\n'

View File

@ -369,7 +369,7 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int,
if text_in_file(person_url,
send_block_filename, False):
send_blocks_str = translate['FollowAccountWarning']
elif text_in_file('://' + search_domain_full,
elif text_in_file('://' + search_domain_full + '\n',
send_block_filename, False):
send_blocks_str = translate['FollowWarning']