Update when receiving likes

merge-requests/8/head
Bob Mottram 2020-12-30 21:21:57 +00:00
parent 6e21a3b84f
commit 9d937826bc
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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',