mirror of https://gitlab.com/bashrc2/epicyon
Update when receiving likes
parent
6e21a3b84f
commit
9d937826bc
6
inbox.py
6
inbox.py
|
@ -964,13 +964,13 @@ def _receiveLike(recentPostsCache: {},
|
||||||
|
|
||||||
handleName = handle.split('@')[0]
|
handleName = handle.split('@')[0]
|
||||||
handleDom = handle.split('@')[1]
|
handleDom = handle.split('@')[1]
|
||||||
|
updateLikesCollection(recentPostsCache, baseDir, postFilename,
|
||||||
|
messageJson['object'],
|
||||||
|
messageJson['actor'], domain, debug)
|
||||||
if not _alreadyLiked(baseDir,
|
if not _alreadyLiked(baseDir,
|
||||||
handleName, handleDom,
|
handleName, handleDom,
|
||||||
messageJson['object'],
|
messageJson['object'],
|
||||||
messageJson['actor']):
|
messageJson['actor']):
|
||||||
updateLikesCollection(recentPostsCache, baseDir, postFilename,
|
|
||||||
messageJson['object'],
|
|
||||||
messageJson['actor'], domain, debug)
|
|
||||||
_likeNotify(baseDir, domain, onionDomain, handle,
|
_likeNotify(baseDir, domain, onionDomain, handle,
|
||||||
messageJson['actor'], messageJson['object'])
|
messageJson['actor'], messageJson['object'])
|
||||||
return True
|
return True
|
||||||
|
|
1
utils.py
1
utils.py
|
@ -1528,6 +1528,7 @@ def updateLikesCollection(recentPostsCache: {},
|
||||||
for likeItem in postJsonObject['object']['likes']['items']:
|
for likeItem in postJsonObject['object']['likes']['items']:
|
||||||
if likeItem.get('actor'):
|
if likeItem.get('actor'):
|
||||||
if likeItem['actor'] == actor:
|
if likeItem['actor'] == actor:
|
||||||
|
# already liked
|
||||||
return
|
return
|
||||||
newLike = {
|
newLike = {
|
||||||
'type': 'Like',
|
'type': 'Like',
|
||||||
|
|
Loading…
Reference in New Issue