From 233ae8e1ca7405cca356ef8e633208c323aa4017 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 28 Mar 2020 17:50:55 +0000 Subject: [PATCH] Relative published link --- webinterface.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webinterface.py b/webinterface.py index dd04fee87..96560bc27 100644 --- a/webinterface.py +++ b/webinterface.py @@ -2808,7 +2808,7 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \ boxName: str,showRepeats=True, \ showIcons=False, \ manuallyApprovesFollowers=False, \ - showPublicOnly=False, + showPublicOnly=False, \ storeToCache=True) -> str: """ Shows a single post as html """ @@ -3305,6 +3305,11 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \ # is this a post to the local domain? if '://'+domain in messageId: publishedLink=messageId.replace('/statuses/','/') + # if this is a local link then make it relative so that it works + # on clearnet or onion address + if domain+'/users/' in publishedLink or \ + domain+':'+str(port)+'/users/' in publishedLink: + publishedLink='/users/'+publishedLink.split('/users/')[1] footerStr=''+publishedStr+'\n'