diff --git a/announce.py b/announce.py index 9fd69010c..9dd01f6e0 100644 --- a/announce.py +++ b/announce.py @@ -238,7 +238,7 @@ def announce_public(session, base_dir: str, federation_list: [], def send_announce_via_server(base_dir: str, session, - fromNickname: str, password: str, + from_nickname: str, password: str, from_domain: str, fromPort: int, http_prefix: str, repeat_object_url: str, cached_webfingers: {}, person_cache: {}, @@ -253,7 +253,7 @@ def send_announce_via_server(base_dir: str, session, from_domain_full = get_full_domain(from_domain, fromPort) to_url = 'https://www.w3.org/ns/activitystreams#Public' - actor_str = local_actor_url(http_prefix, fromNickname, from_domain_full) + actor_str = local_actor_url(http_prefix, from_nickname, from_domain_full) cc_url = actor_str + '/followers' status_number, published = get_status_number() @@ -270,7 +270,7 @@ def send_announce_via_server(base_dir: str, session, 'type': 'Announce' } - handle = http_prefix + '://' + from_domain_full + '/@' + fromNickname + handle = http_prefix + '://' + from_domain_full + '/@' + from_nickname # lookup the inbox for the To handle wf_request = webfinger_handle(session, handle, http_prefix, @@ -296,7 +296,7 @@ def send_announce_via_server(base_dir: str, session, base_dir, session, wf_request, person_cache, project_version, http_prefix, - fromNickname, from_domain, + from_nickname, from_domain, post_to_box, 73528) if not inbox_url: @@ -309,7 +309,7 @@ def send_announce_via_server(base_dir: str, session, print('DEBUG: announce no actor was found for ' + handle) return 4 - auth_header = create_basic_auth_header(fromNickname, password) + auth_header = create_basic_auth_header(from_nickname, password) headers = { 'host': from_domain, diff --git a/blog.py b/blog.py index a3fe001fa..7487f7117 100644 --- a/blog.py +++ b/blog.py @@ -259,7 +259,8 @@ def _html_blog_post_content(debug: bool, session, authorized: bool, mute_str = '' is_muted = False attachment_str, _ = \ - get_post_attachments_as_html(post_json_object, + get_post_attachments_as_html(base_dir, domain_full, + post_json_object, 'tlblogs', translate, is_muted, avatar_link, reply_str, announce_str, diff --git a/cache.py b/cache.py index 1ba24e7e9..4997946e7 100644 --- a/cache.py +++ b/cache.py @@ -143,6 +143,8 @@ def get_person_pub_key(base_dir: str, session, person_url: str, domain: str, onion_domain: str, i2p_domain: str, signing_priv_key_pem: str) -> str: + """Get the public key for an actor + """ if not person_url: return None person_url = person_url.replace('#main-key', '') diff --git a/content.py b/content.py index a640b35b2..5dfc5c03b 100644 --- a/content.py +++ b/content.py @@ -1681,3 +1681,40 @@ def create_edits_html(edits_json: {}, post_json_object: {}, return '
' + \ translate['SHOW EDITS'] + '' + \ edits_str + '
' + + +def remove_script(content: str, log_filename: str, + actor: str, url: str) -> str: + """Removes