From f482f4edacbdbb52520dc758e2e068d8ec5d5d73 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 3 Nov 2019 16:11:52 +0000 Subject: [PATCH] Update avatar if needed --- webinterface.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webinterface.py b/webinterface.py index f93040494..2d639856f 100644 --- a/webinterface.py +++ b/webinterface.py @@ -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