Get the avatar extension

merge-requests/8/head
Bob Mottram 2020-12-20 13:28:33 +00:00
parent 2926b690ce
commit da256d24d2
1 changed files with 4 additions and 1 deletions

View File

@ -189,12 +189,15 @@ def htmlModerationInfo(cssCache: {}, translate: {},
continue continue
actor = actorJson['id'] actor = actorJson['id']
avatarUrl = '' avatarUrl = ''
ext = ''
if actorJson.get('icon'): if actorJson.get('icon'):
if actorJson['icon'].get('url'): if actorJson['icon'].get('url'):
avatarUrl = actorJson['icon']['url'] avatarUrl = actorJson['icon']['url']
if '.' in avatarUrl:
ext = avatarUrl.split('.')[-1]
acctUrl = \ acctUrl = \
'/users/' + nickname + '?options=' + actor + ';1;' + \ '/users/' + nickname + '?options=' + actor + ';1;' + \
'/members/' + acctNickname '/members/' + acctNickname + ext
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 + '" />'