From 3d3b307e8db1262b7946c4a31b1d9f1cb551c476 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 9 Dec 2020 15:57:29 +0000 Subject: [PATCH] Remove like icon from cache when its status changes --- daemon.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/daemon.py b/daemon.py index 24ff29748..44b99b84f 100644 --- a/daemon.py +++ b/daemon.py @@ -5704,6 +5704,11 @@ class PubServer(BaseHTTPRequestHandler): likedPostFilename, likeUrl, likeActor, domain, debug) + # clear the icon from the cache so that it gets updated + if self.server.iconsCache.get('like.png'): + del self.server.iconsCache['like.png'] + if self.server.iconsCache.get('like_inactive.png'): + del self.server.iconsCache['like_inactive.png'] else: print('WARN: unable to locate file for liked post ' + likeUrl) @@ -5808,6 +5813,11 @@ class PubServer(BaseHTTPRequestHandler): baseDir, likedPostFilename, likeUrl, undoActor, domain, debug) + # clear the icon from the cache so that it gets updated + if self.server.iconsCache.get('like.png'): + del self.server.iconsCache['like.png'] + if self.server.iconsCache.get('like_inactive.png'): + del self.server.iconsCache['like_inactive.png'] # send out the undo like to followers self._postToOutbox(undoLikeJson, self.server.projectVersion) self.server.GETbusy = False