mirror of https://gitlab.com/bashrc2/epicyon
Likes debug
parent
c8844bba5e
commit
a927d4ef58
|
@ -2525,11 +2525,15 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
actorLiked)
|
actorLiked)
|
||||||
if likedPostFilename:
|
if likedPostFilename:
|
||||||
|
print('Updating likes for ' + likedPostFilename)
|
||||||
updateLikesCollection(self.server.recentPostsCache,
|
updateLikesCollection(self.server.recentPostsCache,
|
||||||
self.server.baseDir,
|
self.server.baseDir,
|
||||||
likedPostFilename, likeUrl,
|
likedPostFilename, likeUrl,
|
||||||
likeActor, self.server.domain,
|
likeActor, self.server.domain,
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
|
else:
|
||||||
|
print('WARN: unable to locate file for liked post ' +
|
||||||
|
likeUrl)
|
||||||
# send out the like to followers
|
# send out the like to followers
|
||||||
self._postToOutbox(likeJson, self.server.projectVersion)
|
self._postToOutbox(likeJson, self.server.projectVersion)
|
||||||
self.server.GETbusy = False
|
self.server.GETbusy = False
|
||||||
|
@ -2619,6 +2623,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.domain,
|
self.server.domain,
|
||||||
actorLiked)
|
actorLiked)
|
||||||
if likedPostFilename:
|
if likedPostFilename:
|
||||||
|
print('Removing likes for ' + likedPostFilename)
|
||||||
undoLikesCollectionEntry(self.server.recentPostsCache,
|
undoLikesCollectionEntry(self.server.recentPostsCache,
|
||||||
self.server.baseDir,
|
self.server.baseDir,
|
||||||
likedPostFilename, likeUrl,
|
likedPostFilename, likeUrl,
|
||||||
|
|
2
utils.py
2
utils.py
|
@ -892,7 +892,7 @@ def updateLikesCollection(recentPostsCache: {},
|
||||||
objectUrl = objectUrl + '/likes'
|
objectUrl = objectUrl + '/likes'
|
||||||
if not postJsonObject['object'].get('likes'):
|
if not postJsonObject['object'].get('likes'):
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: Adding initial likes to '+objectUrl)
|
print('DEBUG: Adding initial like to ' + objectUrl)
|
||||||
likesJson = {
|
likesJson = {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
'id': objectUrl,
|
'id': objectUrl,
|
||||||
|
|
Loading…
Reference in New Issue