From 37f2ae5776570b95684322bc5d4e7eabd2d862a9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 1 Dec 2019 15:19:11 +0000 Subject: [PATCH] Remove muted post from cache --- posts.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/posts.py b/posts.py index 7c16c41fa..8edebff7a 100644 --- a/posts.py +++ b/posts.py @@ -2693,13 +2693,5 @@ def unmutePost(baseDir: str,nickname: str,domain: str,postId: str, \ getCachedPostFilename(baseDir,nickname,domain,postJsonObject) if cachedPostFilename: if os.path.isfile(cachedPostFilename): - os.remove(cachedPostFilename) - # if the post is in the recent posts cache then mark it as not muted - if recentPostsCache.get('index'): - postId=postJsonObject['id'].replace('/activity','').replace('/','#') - if postId in recentPostsCache['index']: - print('UNMUTE: '+postId+' is in recent posts cache') - if recentPostsCache['json'].get(postId): - postJsonObject['muted']=False - recentPostsCache['json'][postId]=json.dumps(postJsonObject) - print('UNMUTE: '+postId+' marked as not muted in recent posts cache') + os.remove(cachedPostFilename) + removePostFromCache(postJsonObject,recentPostsCache)