From 6e2d2d112f7454c67893710bebdaa3d2ba91967e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 31 Aug 2020 10:58:29 +0100 Subject: [PATCH] Remove cached html for muted post when state changes --- posts.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/posts.py b/posts.py index 4339d22e..235aa0f3 100644 --- a/posts.py +++ b/posts.py @@ -3559,12 +3559,7 @@ def mutePost(baseDir: str, nickname: str, domain: str, postId: str, recentPostsCache['json'][postId] = json.dumps(postJsonObject) if recentPostsCache.get('html'): if recentPostsCache['html'].get(postId): - postHtml = recentPostsCache['html'][postId] - if '/mute.png' in postHtml: - postHtml = \ - postHtml.replace('/mute.png', '/unmute.png') - recentPostsCache['html'][postId] = \ - postHtml.replace('?mute=', '?unmute=') + del recentPostsCache['html'][postId] print('MUTE: ' + postId + ' marked as muted in recent posts memory cache') @@ -3604,12 +3599,7 @@ def unmutePost(baseDir: str, nickname: str, domain: str, postId: str, recentPostsCache['json'][postId] = json.dumps(postJsonObject) if recentPostsCache.get('html'): if recentPostsCache['html'].get(postId): - postHtml = recentPostsCache['html'][postId] - if '/unmute.png' in postHtml: - postHtml = \ - postHtml.replace('/unmute.png', '/mute.png') - recentPostsCache['html'][postId] = \ - postHtml.replace('?unmute=', '?mute=') + del recentPostsCache['html'][postId] print('UNMUTE: ' + postId + ' marked as unmuted in recent posts cache')