From 7c5317224a971353dc4ff5549a2bf89ae6865350 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 7 May 2021 20:57:13 +0100 Subject: [PATCH] Check that share is added to announce post --- webapp_post.py | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index 4ec743f7f..e965f484c 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -21,6 +21,7 @@ from posts import postIsMuted from posts import getPersonBox from posts import downloadAnnounce from posts import populateRepliesJson +from utils import updateAnnounceCollection from utils import isPGPEncrypted from utils import isDM from utils import rejectPostId @@ -1302,21 +1303,26 @@ def individualPostAsHtml(allowDownloads: bool, return '' postJsonObject = postJsonAnnounce - if isRecentPost(postJsonObject): - announceFilename = \ - locatePost(baseDir, nickname, domain, - postJsonObject['id']) - if announceFilename and postJsonObject.get('actor'): - if not os.path.isfile(announceFilename + '.tts'): - updateSpeaker(baseDir, httpPrefix, - nickname, domain, domainFull, - postJsonObject, personCache, - translate, postJsonObject['actor'], - themeName) - ttsFile = open(announceFilename + '.tts', "w+") - if ttsFile: - ttsFile.write('\n') - ttsFile.close() + announceFilename = \ + locatePost(baseDir, nickname, domain, + postJsonObject['id']) + if announceFilename: + updateAnnounceCollection(recentPostsCache, + baseDir, announceFilename, + postActor, domainFull, False) + + if isRecentPost(postJsonObject): + if postJsonObject.get('actor'): + if not os.path.isfile(announceFilename + '.tts'): + updateSpeaker(baseDir, httpPrefix, + nickname, domain, domainFull, + postJsonObject, personCache, + translate, postJsonObject['actor'], + themeName) + ttsFile = open(announceFilename + '.tts', "w+") + if ttsFile: + ttsFile.write('\n') + ttsFile.close() isAnnounced = True