From d5c27287af0c4cffc9ed2b6f00b5a72a334cfe5d Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Thu, 1 Sep 2022 21:00:14 +0200 Subject: [PATCH] Fix admin in reply to link --- app/ap_object.py | 7 +++++++ app/templates/utils.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/ap_object.py b/app/ap_object.py index 050ef33..6c65b14 100644 --- a/app/ap_object.py +++ b/app/ap_object.py @@ -208,6 +208,13 @@ class Object: def in_reply_to(self) -> str | None: return self.ap_object.get("inReplyTo") + @property + def is_in_reply_to_from_inbox(self) -> bool | None: + if not self.in_reply_to: + return None + + return not self.in_reply_to.startswith(LOCAL_ACTOR.ap_id) + @property def has_ld_signature(self) -> bool: return bool(self.ap_object.get("signature")) diff --git a/app/templates/utils.html b/app/templates/utils.html index 871134b..246c5c8 100644 --- a/app/templates/utils.html +++ b/app/templates/utils.html @@ -365,7 +365,7 @@ {% endif %} {% if object.in_reply_to %} - + in reply to {{ object.in_reply_to|truncate(64, True) }} {% endif %}