From 824d933aee0bca3dcd840b9aa91c095722becd0e Mon Sep 17 00:00:00 2001 From: lichenblankie Date: Fri, 5 Jun 2026 02:10:12 +0000 Subject: [PATCH] hide block link + show 'me' for own content by matching identity hash --- tinyweb_forum/handlers.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tinyweb_forum/handlers.py b/tinyweb_forum/handlers.py index 3ec6bb9..5875210 100644 --- a/tinyweb_forum/handlers.py +++ b/tinyweb_forum/handlers.py @@ -50,13 +50,20 @@ class ForumHandlers: return False return secrets.compare_digest(token, expected) - def _author_str(self, name, instance): + def _is_local(self, instance): if instance == "local": + return True + if self.identity and instance == self.identity.hash.hex(): + return True + return False + + def _author_str(self, name, instance): + if self._is_local(instance): return "me" return instance[:6] def _block_link(self, instance): - if instance == "local": + if self._is_local(instance): return "" return f' [block]'