From f521dfd1090100b4af4d37f7fb0771c029fe6157 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 6 Oct 2024 18:38:57 +0100 Subject: [PATCH] Create thread id if none exists --- posts.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/posts.py b/posts.py index 1f1212d65..52df04280 100644 --- a/posts.py +++ b/posts.py @@ -131,6 +131,7 @@ from followerSync import update_followers_sync_cache from question import is_question from question import dangerous_question from pyjsonld import JsonLdError +from conversation import conversation_tag_to_convthread_id def convert_post_content_to_html(message_json: {}) -> None: @@ -1283,6 +1284,10 @@ def _create_post_s2s(base_dir: str, nickname: str, domain: str, port: int, conversation_id = new_post_id if not isinstance(conversation_id, str): conversation_id = new_post_id + if conversation_id.startswith('tag:'): + new_convthread_id = conversation_tag_to_convthread_id(conversation_id) + if new_convthread_id: + convthread_id = new_convthread_id # add opt-outs as in: # https://codeberg.org/fediverse/fep/src/branch/main/fep/5e53/fep-5e53.md new_post = { @@ -1398,6 +1403,10 @@ def _create_post_c2s(base_dir: str, nickname: str, domain: str, port: int, conversation_id = new_post_id if not isinstance(conversation_id, str): conversation_id = new_post_id + if conversation_id.startswith('tag:'): + new_convthread_id = conversation_tag_to_convthread_id(conversation_id) + if new_convthread_id: + convthread_id = new_convthread_id # add opt-outs as in: # https://codeberg.org/fediverse/fep/src/branch/main/fep/5e53/fep-5e53.md new_post = {