diff --git a/daemon.py b/daemon.py index eba734917..2560cfd3d 100644 --- a/daemon.py +++ b/daemon.py @@ -544,7 +544,7 @@ class PubServer(BaseHTTPRequestHandler): nickname, self.server.domain, self.server.port, self.server.http_prefix, - answer, False, False, False, + answer, False, False, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -18902,7 +18902,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, self.server.http_prefix, mentions_str + fields['message'], - False, False, False, comments_enabled, + False, False, comments_enabled, filename, attachment_media_type, fields['imageDescription'], city, diff --git a/epicyon.py b/epicyon.py index 03a7d7836..686dcf646 100644 --- a/epicyon.py +++ b/epicyon.py @@ -3198,7 +3198,6 @@ def _command_options() -> None: delete_all_posts(base_dir, nickname, domain, 'inbox') delete_all_posts(base_dir, nickname, domain, 'outbox') - test_followers_only = False test_save_to_file = True test_c2s = False test_comments_enabled = True @@ -3221,7 +3220,6 @@ def _command_options() -> None: create_public_post(base_dir, nickname, domain, port, http_prefix, "like this is totally just a #test man", - test_followers_only, test_save_to_file, test_c2s, test_comments_enabled, @@ -3236,7 +3234,6 @@ def _command_options() -> None: languages_understood) create_public_post(base_dir, nickname, domain, port, http_prefix, "Zoiks!!!", - test_followers_only, test_save_to_file, test_c2s, test_comments_enabled, @@ -3251,7 +3248,6 @@ def _command_options() -> None: languages_understood) create_public_post(base_dir, nickname, domain, port, http_prefix, "Hey scoob we need like a hundred more #milkshakes", - test_followers_only, test_save_to_file, test_c2s, test_comments_enabled, @@ -3266,7 +3262,6 @@ def _command_options() -> None: languages_understood) create_public_post(base_dir, nickname, domain, port, http_prefix, "Getting kinda spooky around here", - test_followers_only, test_save_to_file, test_c2s, test_comments_enabled, @@ -3282,7 +3277,6 @@ def _command_options() -> None: create_public_post(base_dir, nickname, domain, port, http_prefix, "And they would have gotten away with it too" + "if it wasn't for those pesky hackers", - test_followers_only, test_save_to_file, test_c2s, test_comments_enabled, @@ -3297,7 +3291,6 @@ def _command_options() -> None: languages_understood) create_public_post(base_dir, nickname, domain, port, http_prefix, "man these centralized sites are like the worst!", - test_followers_only, test_save_to_file, test_c2s, test_comments_enabled, @@ -3312,7 +3305,6 @@ def _command_options() -> None: languages_understood) create_public_post(base_dir, nickname, domain, port, http_prefix, "another mystery solved #test", - test_followers_only, test_save_to_file, test_c2s, test_comments_enabled, @@ -3327,7 +3319,6 @@ def _command_options() -> None: languages_understood) create_public_post(base_dir, nickname, domain, port, http_prefix, "let's go bowling", - test_followers_only, test_save_to_file, test_c2s, test_comments_enabled, diff --git a/posts.py b/posts.py index 272126773..30c5cf39a 100644 --- a/posts.py +++ b/posts.py @@ -1411,7 +1411,7 @@ def get_actor_from_in_reply_to(in_reply_to: str) -> str: def _create_post_base(base_dir: str, nickname: str, domain: str, port: int, to_url: str, cc_url: str, http_prefix: str, content: str, - followers_only: bool, save_to_file: bool, + save_to_file: bool, client_to_server: bool, comments_enabled: bool, attach_image_filename: str, media_type: str, image_description: str, city: str, @@ -1833,7 +1833,7 @@ def regenerate_index_for_box(base_dir: str, def create_public_post(base_dir: str, nickname: str, domain: str, port: int, http_prefix: str, - content: str, followers_only: bool, save_to_file: bool, + content: str, save_to_file: bool, client_to_server: bool, comments_enabled: bool, attach_image_filename: str, media_type: str, image_description: str, city: str, @@ -1863,8 +1863,7 @@ def create_public_post(base_dir: str, return _create_post_base(base_dir, nickname, domain, port, 'https://www.w3.org/ns/activitystreams#Public', local_actor + '/followers', - http_prefix, content, followers_only, - save_to_file, + http_prefix, content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -1928,7 +1927,7 @@ def create_blog_post(base_dir: str, blog_json = \ create_public_post(base_dir, nickname, domain, port, http_prefix, - content, followers_only, save_to_file, + content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -1965,7 +1964,7 @@ def create_news_post(base_dir: str, blog = \ create_public_post(base_dir, 'news', domain, port, http_prefix, - content, followers_only, save_to_file, + content, save_to_file, client_to_server, False, attach_image_filename, media_type, image_description, city, @@ -1999,7 +1998,7 @@ def create_question_post(base_dir: str, _create_post_base(base_dir, nickname, domain, port, 'https://www.w3.org/ns/activitystreams#Public', local_actor + '/followers', - http_prefix, content, followers_only, save_to_file, + http_prefix, content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -2052,8 +2051,7 @@ def create_unlisted_post(base_dir: str, return _create_post_base(base_dir, nickname, domain, port, local_actor + '/followers', 'https://www.w3.org/ns/activitystreams#Public', - http_prefix, content, followers_only, - save_to_file, + http_prefix, content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -2090,8 +2088,7 @@ def create_followers_only_post(base_dir: str, local_actor = local_actor_url(http_prefix, nickname, domain_full) return _create_post_base(base_dir, nickname, domain, port, local_actor + '/followers', None, - http_prefix, content, followers_only, - save_to_file, + http_prefix, content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -2173,7 +2170,7 @@ def create_direct_message_post(base_dir: str, message_json = \ _create_post_base(base_dir, nickname, domain, port, post_to, post_cc, - http_prefix, content, followers_only, save_to_file, + http_prefix, content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -2277,8 +2274,7 @@ def create_report_post(base_dir: str, post_json_object = \ _create_post_base(base_dir, nickname, domain, port, to_url, post_cc, - http_prefix, content, followers_only, - save_to_file, + http_prefix, content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -2466,7 +2462,7 @@ def send_post(signing_priv_key_pem: str, project_version: str, post_json_object = \ _create_post_base(base_dir, nickname, domain, port, to_person_id, cc_str, http_prefix, content, - followers_only, save_to_file, client_to_server, + save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -2653,7 +2649,7 @@ def send_post_via_server(signing_priv_key_pem: str, project_version: str, _create_post_base(base_dir, from_nickname, from_domain, from_port, to_person_id, cc_str, http_prefix, content, - followers_only, save_to_file, client_to_server, + save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, diff --git a/tests.py b/tests.py index 202747f00..db310d5e3 100644 --- a/tests.py +++ b/tests.py @@ -741,7 +741,6 @@ def create_server_alice(path: str, domain: str, port: int, add_follower_of_person(path, nickname, domain, 'bob', bob_address, federation_list, False, False) if hasPosts: - test_followers_only = False test_save_to_file = True client_to_server = False test_comments_enabled = True @@ -762,7 +761,6 @@ def create_server_alice(path: str, domain: str, port: int, content_license_url = 'https://creativecommons.org/licenses/by/4.0' create_public_post(path, nickname, domain, port, http_prefix, "No wise fish would go anywhere without a porpoise", - test_followers_only, test_save_to_file, client_to_server, test_comments_enabled, @@ -778,7 +776,6 @@ def create_server_alice(path: str, domain: str, port: int, languages_understood) create_public_post(path, nickname, domain, port, http_prefix, "Curiouser and curiouser!", - test_followers_only, test_save_to_file, client_to_server, test_comments_enabled, @@ -795,7 +792,6 @@ def create_server_alice(path: str, domain: str, port: int, create_public_post(path, nickname, domain, port, http_prefix, "In the gardens of memory, in the palace " + "of dreams, that is where you and I shall meet", - test_followers_only, test_save_to_file, client_to_server, test_comments_enabled, @@ -905,7 +901,6 @@ def create_server_bob(path: str, domain: str, port: int, 'alice', alice_address, federation_list, False, False) if hasPosts: - test_followers_only = False test_save_to_file = True test_comments_enabled = True test_attach_image_filename = None @@ -925,7 +920,6 @@ def create_server_bob(path: str, domain: str, port: int, content_license_url = 'https://creativecommons.org/licenses/by/4.0' create_public_post(path, nickname, domain, port, http_prefix, "It's your life, live it your way.", - test_followers_only, test_save_to_file, client_to_server, test_comments_enabled, @@ -942,7 +936,6 @@ def create_server_bob(path: str, domain: str, port: int, create_public_post(path, nickname, domain, port, http_prefix, "One of the things I've realised is that " + "I am very simple", - test_followers_only, test_save_to_file, client_to_server, test_comments_enabled, @@ -958,7 +951,6 @@ def create_server_bob(path: str, domain: str, port: int, languages_understood) create_public_post(path, nickname, domain, port, http_prefix, "Quantum physics is a bit of a passion of mine", - test_followers_only, test_save_to_file, client_to_server, test_comments_enabled, @@ -2838,7 +2830,6 @@ def _test_create_person_account(base_dir: str): test_event_end_time = None test_location = None test_is_article = False - followers_only = False save_to_file = True comments_enabled = True attach_image_filename = None @@ -2853,7 +2844,7 @@ def _test_create_person_account(base_dir: str): "anything which challenges middle class sensibilities or incomes." test_post_json = \ create_public_post(base_dir, nickname, domain, port, http_prefix, - content, followers_only, save_to_file, + content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, 'Not suitable for Vogons', 'London, England', @@ -2879,7 +2870,7 @@ def _test_create_person_account(base_dir: str): 'then email would be somequitelongword.\nAnotherlongwordhere sentence.' test_post_json = \ create_public_post(base_dir, nickname, domain, port, http_prefix, - content, followers_only, save_to_file, + content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, 'Not suitable for Vogons', 'London, England', @@ -4643,7 +4634,6 @@ def _test_reply_to_public_post(base_dir: str) -> None: post_id = \ http_prefix + '://rat.site/users/ninjarodent/statuses/63746173435' content = "@ninjarodent@rat.site This is a test." - followers_only = False save_to_file = False client_to_server = False comments_enabled = True @@ -4665,7 +4655,7 @@ def _test_reply_to_public_post(base_dir: str) -> None: content_license_url = 'https://creativecommons.org/licenses/by/4.0' reply = \ create_public_post(base_dir, nickname, domain, port, http_prefix, - content, followers_only, save_to_file, + content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, test_in_reply_to, @@ -5574,7 +5564,6 @@ def _test_links_within_post(base_dir: str) -> None: http_prefix = 'https' content = 'This is a test post with links.\n\n' + \ 'ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/v4/\n\nhttps://libreserver.org' - followers_only = False save_to_file = False client_to_server = False comments_enabled = True @@ -5597,7 +5586,7 @@ def _test_links_within_post(base_dir: str) -> None: post_json_object = \ create_public_post(base_dir, nickname, domain, port, http_prefix, - content, followers_only, save_to_file, + content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city, @@ -5641,7 +5630,7 @@ def _test_links_within_post(base_dir: str) -> None: post_json_object = \ create_public_post(base_dir, nickname, domain, port, http_prefix, content, - False, False, + False, False, True, None, None, False, None, @@ -6590,7 +6579,6 @@ def _test_can_replyto(base_dir: str) -> None: http_prefix = 'https' content = 'This is a test post with links.\n\n' + \ 'ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/v4/\n\nhttps://libreserver.org' - followers_only = False save_to_file = False client_to_server = False comments_enabled = True @@ -6613,7 +6601,7 @@ def _test_can_replyto(base_dir: str) -> None: post_json_object = \ create_public_post(base_dir, nickname, domain, port, http_prefix, - content, followers_only, save_to_file, + content, save_to_file, client_to_server, comments_enabled, attach_image_filename, media_type, image_description, city,