Remove cached json for muted announce

merge-requests/30/head
Bob Mottram 2021-09-28 16:48:14 +01:00
parent d3e341b594
commit 29ac6e95ff
1 changed files with 21 additions and 8 deletions

View File

@ -554,7 +554,13 @@ def mutePost(baseDir: str, nickname: str, domain: str, port: int,
if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId]
print('MUTE: ' + postId + ' removed cached html')
if alsoUpdatePostId and recentPostsCache.get('html'):
if alsoUpdatePostId:
if recentPostsCache.get('json'):
if recentPostsCache['json'].get(alsoUpdatePostId):
del recentPostsCache['json'][alsoUpdatePostId]
print('MUTE: ' + alsoUpdatePostId + ' removed referenced json')
if recentPostsCache.get('html'):
if recentPostsCache['html'].get(alsoUpdatePostId):
del recentPostsCache['html'][alsoUpdatePostId]
print('MUTE: ' + alsoUpdatePostId + ' removed referenced html')
@ -642,10 +648,17 @@ def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
if recentPostsCache['html'].get(postId):
del recentPostsCache['html'][postId]
print('UNMUTE: ' + postId + ' removed cached html')
if alsoUpdatePostId and recentPostsCache.get('html'):
if alsoUpdatePostId:
if recentPostsCache.get('json'):
if recentPostsCache['json'].get(alsoUpdatePostId):
del recentPostsCache['json'][alsoUpdatePostId]
print('UNMUTE: ' +
alsoUpdatePostId + ' removed referenced json')
if recentPostsCache.get('html'):
if recentPostsCache['html'].get(alsoUpdatePostId):
del recentPostsCache['html'][alsoUpdatePostId]
print('MUTE: ' + alsoUpdatePostId + ' removed referenced html')
print('UNMUTE: ' +
alsoUpdatePostId + ' removed referenced html')
def outboxMute(baseDir: str, httpPrefix: str,