Use function to generate actor url

main
Bob Mottram 2021-10-22 10:10:23 +01:00
parent 88c4b14ca3
commit 343c9771bb
3 changed files with 5 additions and 4 deletions

View File

@ -3497,7 +3497,7 @@ class PubServer(BaseHTTPRequestHandler):
shareActor = shareActor.split('&')[0]
adminNickname = getConfigParam(baseDir, 'admin')
adminActor = \
httpPrefix + '://' + domainFull + '/users' + adminNickname
localActorUrl(httpPrefix, domainFull, adminNickname)
actor = originPathStr
actorNickname = getNicknameFromActor(actor)
if actor == shareActor or actor == adminActor or \
@ -3564,7 +3564,7 @@ class PubServer(BaseHTTPRequestHandler):
shareActor = shareActor.split('&')[0]
adminNickname = getConfigParam(baseDir, 'admin')
adminActor = \
httpPrefix + '://' + domainFull + '/users' + adminNickname
localActorUrl(httpPrefix, domainFull, adminNickname)
actor = originPathStr
actorNickname = getNicknameFromActor(actor)
if actor == shareActor or actor == adminActor or \

View File

@ -172,7 +172,7 @@ def _updateCachedHashtagSwarm(baseDir: str, nickname: str, domain: str,
else:
print('WARN: no modified date for ' + str(lastModified))
if saveSwarm:
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
actor = localActorUrl(httpPrefix, domainFull, nickname)
newSwarmStr = htmlHashTagSwarm(baseDir, actor, translate)
if newSwarmStr:
try:

View File

@ -15,6 +15,7 @@ from utils import getImageExtensions
from utils import copytree
from utils import acctDir
from utils import dangerousSVG
from utils import localActorUrl
from shutil import copyfile
from shutil import make_archive
from shutil import unpack_archive
@ -736,7 +737,7 @@ def setNewsAvatar(baseDir: str, name: str,
if not os.path.isfile(newFilename):
return
avatarFilename = \
httpPrefix + '://' + domainFull + '/users/' + nickname + '.png'
localActorUrl(httpPrefix, domainFull, nickname) + '.png'
avatarFilename = avatarFilename.replace('/', '-')
filename = baseDir + '/cache/avatars/' + avatarFilename