diff --git a/webapp_create_post.py b/webapp_create_post.py index 6ba4098bf..733792a8b 100644 --- a/webapp_create_post.py +++ b/webapp_create_post.py @@ -24,6 +24,7 @@ from utils import get_currencies from utils import get_category_types from utils import get_account_timezone from utils import get_supported_languages +from utils import text_in_file from webapp_utils import edit_check_box from webapp_utils import get_buy_links from webapp_utils import html_following_data_list @@ -373,6 +374,33 @@ def html_new_post(edit_post_params: {}, '" rel="nofollow noopener noreferrer" ' + \ 'target="_blank">' + \ translate['this post'] + '

\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): + reply_actor = in_reply_to + reply_nickname = get_nickname_from_actor(in_reply_to) + if reply_nickname: + reply_actor = \ + in_reply_to.split('/' + reply_nickname)[0] + \ + '/' + reply_nickname + if text_in_file(reply_actor, + send_block_filename, False): + new_post_text += \ + '

' + \ + translate['FollowAccountWarning'] + \ + '

\n' + else: + reply_domain, _ = \ + get_domain_from_actor(reply_actor) + if text_in_file('://' + reply_domain + '\n', + send_block_filename, False): + new_post_text += \ + '

' + \ + translate['FollowWarning'] + '

\n' + if post_json_object: timezone = \ get_account_timezone(base_dir, nickname, domain)