Displaying account avatars

main
Bob Mottram 2020-12-20 13:01:12 +00:00
parent e42ba610c2
commit 5e6e2f80c5
2 changed files with 7 additions and 1 deletions

View File

@ -5084,6 +5084,12 @@ class PubServer(BaseHTTPRequestHandler):
optionsActor = optionsList[0] optionsActor = optionsList[0]
optionsPageNumber = optionsList[1] optionsPageNumber = optionsList[1]
optionsProfileUrl = optionsList[2] optionsProfileUrl = optionsList[2]
if '.' in optionsProfileUrl and \
optionsProfileUrl.startswith('/members/'):
ext = optionsProfileUrl.split('.')[-1]
optionsProfileUrl = optionsProfileUrl.split('/members/')[0]
optionsProfileUrl = \
'/users/' + optionsProfileUrl + '/avatar.' + ext
if optionsPageNumber.isdigit(): if optionsPageNumber.isdigit():
pageNumber = int(optionsPageNumber) pageNumber = int(optionsPageNumber)
optionsLink = None optionsLink = None

View File

@ -194,7 +194,7 @@ def htmlModerationInfo(cssCache: {}, translate: {},
avatarUrl = actorJson['icon']['url'] avatarUrl = actorJson['icon']['url']
acctUrl = \ acctUrl = \
'/users/' + nickname + '?options=' + actor + ';1;' + \ '/users/' + nickname + '?options=' + actor + ';1;' + \
'/avatars/' + avatarUrl.replace('/', '-') '/members/' + acctNickname
infoForm += '<td>\n<a href="' + acctUrl + '">' infoForm += '<td>\n<a href="' + acctUrl + '">'
infoForm += '<img loading="lazy" style="width:90%" ' infoForm += '<img loading="lazy" style="width:90%" '
infoForm += 'src="' + avatarUrl + '" />' infoForm += 'src="' + avatarUrl + '" />'