Update avatar if needed

main2
Bob Mottram 2019-11-03 16:11:52 +00:00
parent ad92d8ee08
commit f482f4edac
1 changed files with 7 additions and 2 deletions

View File

@ -1830,15 +1830,20 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
storeToCache=True) -> str:
""" Shows a single post as html
"""
postActor=postJsonObject['actor']
if not showPublicOnly and storeToCache and boxName!='tlmedia':
# update avatar if needed
if not avatarUrl:
avatarUrl=getPersonAvatarUrl(baseDir,postActor,personCache)
updateAvatarImageCache(session,baseDir,httpPrefix,postActor,avatarUrl,personCache)
postHtml= \
loadIndividualPostAsHtmlFromCache(baseDir,nickname,domain, \
postJsonObject)
if postHtml:
return postHtml.replace(';-999;',';'+str(pageNumber)+';').replace('?page=-999','?page='+str(pageNumber))
postActor=postJsonObject['actor']
# If this is the inbox timeline then don't show the repeat icon on any DMs
showRepeatIcon=showRepeats
showDMicon=False