Relative published link

main
Bob Mottram 2020-03-28 17:50:55 +00:00
parent 0f30362f61
commit 233ae8e1ca
1 changed files with 6 additions and 1 deletions

View File

@ -2808,7 +2808,7 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \
boxName: str,showRepeats=True, \ boxName: str,showRepeats=True, \
showIcons=False, \ showIcons=False, \
manuallyApprovesFollowers=False, \ manuallyApprovesFollowers=False, \
showPublicOnly=False, showPublicOnly=False, \
storeToCache=True) -> str: storeToCache=True) -> str:
""" Shows a single post as html """ Shows a single post as html
""" """
@ -3305,6 +3305,11 @@ def individualPostAsHtml(recentPostsCache: {},maxRecentPosts: int, \
# is this a post to the local domain? # is this a post to the local domain?
if '://'+domain in messageId: if '://'+domain in messageId:
publishedLink=messageId.replace('/statuses/','/') 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='<a href="'+publishedLink+'" class="'+timeClass+'">'+publishedStr+'</a>\n' footerStr='<a href="'+publishedLink+'" class="'+timeClass+'">'+publishedStr+'</a>\n'