From deef6ce177b7a78f7f46588a577b55470960f20f Mon Sep 17 00:00:00 2001 From: mst Date: Tue, 11 Mar 2025 16:08:10 +0300 Subject: [PATCH] start a fedi crosspost thread if fedi crosspost is enabled --- app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index b858154..6ce2143 100644 --- a/app.py +++ b/app.py @@ -712,7 +712,13 @@ def addAnswer(): if not answer: abort(400, _("Missing 'answer' attribute or 'answer' is empty")) - return func.addAnswer(question_id, answer, cw) + return_val = func.addAnswer(question_id, answer, cw) + + if cfg['crosspost']['fediverse']['enabled']: + fedi_crosspost_thread = threading.Thread(target=func.postOnFediverse, name=f"fediverse crosspost thread for {question_id}", args=(question_id, answer, cw,)) + fedi_crosspost_thread.start() + + return return_val # -- uploaders --