hide block link + show 'me' for own content by matching identity hash

This commit is contained in:
lichenblankie 2026-06-05 02:10:12 +00:00
parent ec9e1754e4
commit 824d933aee

View file

@ -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' <a class="forum-action-inline" href="/forum/blockhash/{instance}">[block]</a>'