From 65aba06e11793daf66493651b6eac6aca4c6ebd1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 26 May 2024 12:57:06 +0100 Subject: [PATCH] Improve obtaining actor from post path --- cache.py | 3 ++- inbox.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cache.py b/cache.py index a1e7ee7b1..cef0e4351 100644 --- a/cache.py +++ b/cache.py @@ -11,6 +11,7 @@ import os from session import url_exists from session import get_json from session import get_json_valid +from utils import contains_statuses from utils import load_json from utils import save_json from utils import get_file_case_insensitive @@ -82,7 +83,7 @@ def store_person_in_cache(base_dir: str, person_url: str, allow_write_to_file: bool) -> None: """Store an actor in the cache """ - if 'statuses' in person_url or person_url.endswith('/actor'): + if contains_statuses(person_url) or person_url.endswith('/actor'): # This is not an actor or person account return diff --git a/inbox.py b/inbox.py index 49b1a19b7..f402cce0a 100644 --- a/inbox.py +++ b/inbox.py @@ -3739,7 +3739,7 @@ def _obtain_avatar_for_reply_post(session, base_dir: str, http_prefix: str, return if '/statuses/' in lookup_actor: - lookup_actor = lookup_actor.split('/statuses/')[0] + lookup_actor = get_actor_from_post_id(lookup_actor) if debug: print('DEBUG: Obtaining actor for reply post ' + lookup_actor)