From aea5fbae6b5316305b4403813e3bd2ab41ef336c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 9 Dec 2022 13:00:14 +0000 Subject: [PATCH] Save to both outbox and inbox --- posts.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/posts.py b/posts.py index 11c8eaf12..0d0b82f5e 100644 --- a/posts.py +++ b/posts.py @@ -940,6 +940,11 @@ def save_post_to_box(base_dir: str, http_prefix: str, post_id: str, filename = box_dir + '/' + post_id.replace('/', '#') + '.json' save_json(post_json_object, filename) + # if this is an outbox post with a duplicate in the inbox then save to both + if '/outbox/' in filename: + inbox_filename = filename.replace('/outbox/', '/inbox/') + if os.path.isfile(inbox_filename): + save_json(post_json_object, inbox_filename) return filename