mirror of https://gitlab.com/bashrc2/epicyon
Clearing cache when new like is received
parent
ede2162d7c
commit
bbde34144f
|
@ -6721,7 +6721,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
updateLikesCollection(self.server.recentPostsCache,
|
||||
baseDir,
|
||||
likedPostFilename, likeUrl,
|
||||
likeActor, domain,
|
||||
likeActor,
|
||||
self.postToNickname, domain,
|
||||
debug)
|
||||
# clear the icon from the cache so that it gets updated
|
||||
if self.server.iconsCache.get('like.png'):
|
||||
|
|
3
inbox.py
3
inbox.py
|
@ -1010,7 +1010,8 @@ def _receiveLike(recentPostsCache: {},
|
|||
_likeNotify(baseDir, domain, onionDomain, handle,
|
||||
messageJson['actor'], postLikedId)
|
||||
updateLikesCollection(recentPostsCache, baseDir, postFilename,
|
||||
postLikedId, messageJson['actor'], domain, debug)
|
||||
postLikedId, messageJson['actor'],
|
||||
handleName, domain, debug)
|
||||
return True
|
||||
|
||||
|
||||
|
|
6
like.py
6
like.py
|
@ -103,7 +103,8 @@ def _like(recentPostsCache: {},
|
|||
|
||||
updateLikesCollection(recentPostsCache,
|
||||
baseDir, postFilename, objectUrl,
|
||||
newLikeJson['actor'], domain, debug)
|
||||
newLikeJson['actor'],
|
||||
nickname, domain, debug)
|
||||
|
||||
sendSignedJson(newLikeJson, session, baseDir,
|
||||
nickname, domain, port,
|
||||
|
@ -334,7 +335,8 @@ def outboxLike(recentPostsCache: {},
|
|||
return True
|
||||
updateLikesCollection(recentPostsCache,
|
||||
baseDir, postFilename, messageId,
|
||||
messageJson['actor'], domain, debug)
|
||||
messageJson['actor'],
|
||||
nickname, domain, debug)
|
||||
if debug:
|
||||
print('DEBUG: post liked via c2s - ' + postFilename)
|
||||
|
||||
|
|
5
utils.py
5
utils.py
|
@ -1886,8 +1886,8 @@ def undoLikesCollectionEntry(recentPostsCache: {},
|
|||
|
||||
def updateLikesCollection(recentPostsCache: {},
|
||||
baseDir: str, postFilename: str,
|
||||
objectUrl: str,
|
||||
actor: str, domain: str, debug: bool) -> None:
|
||||
objectUrl: str, actor: str,
|
||||
nickname: str, domain: str, debug: bool) -> None:
|
||||
"""Updates the likes collection within a post
|
||||
"""
|
||||
postJsonObject = loadJson(postFilename)
|
||||
|
@ -1896,7 +1896,6 @@ def updateLikesCollection(recentPostsCache: {},
|
|||
# remove any cached version of this post so that the
|
||||
# like icon is changed
|
||||
removePostFromCache(postJsonObject, recentPostsCache)
|
||||
nickname = getNicknameFromActor(actor)
|
||||
cachedPostFilename = getCachedPostFilename(baseDir, nickname,
|
||||
domain, postJsonObject)
|
||||
if cachedPostFilename:
|
||||
|
|
Loading…
Reference in New Issue