From 9d937826bc668a1c7b260e50e567e1b3cd487c1b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 30 Dec 2020 21:21:57 +0000 Subject: [PATCH] Update when receiving likes --- inbox.py | 6 +++--- utils.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inbox.py b/inbox.py index 54e042cac..16ab4d4bc 100644 --- a/inbox.py +++ b/inbox.py @@ -964,13 +964,13 @@ def _receiveLike(recentPostsCache: {}, handleName = handle.split('@')[0] handleDom = handle.split('@')[1] + updateLikesCollection(recentPostsCache, baseDir, postFilename, + messageJson['object'], + messageJson['actor'], domain, debug) if not _alreadyLiked(baseDir, handleName, handleDom, messageJson['object'], messageJson['actor']): - updateLikesCollection(recentPostsCache, baseDir, postFilename, - messageJson['object'], - messageJson['actor'], domain, debug) _likeNotify(baseDir, domain, onionDomain, handle, messageJson['actor'], messageJson['object']) return True diff --git a/utils.py b/utils.py index 99d8a8637..81682d1e1 100644 --- a/utils.py +++ b/utils.py @@ -1528,6 +1528,7 @@ def updateLikesCollection(recentPostsCache: {}, for likeItem in postJsonObject['object']['likes']['items']: if likeItem.get('actor'): if likeItem['actor'] == actor: + # already liked return newLike = { 'type': 'Like',