From 5243f1437ad7f417a5dc1dc0b59a94d4c5919edb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 10 Jul 2023 20:42:58 +0100 Subject: [PATCH] Display the domain for chat links Gives the reader a bit more of a heads up --- webapp_utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/webapp_utils.py b/webapp_utils.py index fb595b947..1c5419e0e 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -1357,10 +1357,18 @@ def get_post_attachments_as_html(base_dir: str, '://' not in attach['href'] or \ '.' not in attach['href']: continue + # get the domain for the chat link + chat_domain_str = '' + chat_domain, _ = get_domain_from_actor(attach['href']) + if chat_domain: + chat_domain_str = ' (' + chat_domain + ')' + # avoid displaying very long domains + if len(chat_domain_str) > 50: + chat_domain_str = '' attachment_str += \ '

' + \ - '💬 ' + translate['Chat'] + '

' + '💬 ' + translate['Chat'] + chat_domain_str + '

' # obtain transcripts transcripts = {}