Likes debug

main
Bob Mottram 2020-06-07 09:53:34 +01:00
parent c8844bba5e
commit a927d4ef58
2 changed files with 6 additions and 1 deletions

View File

@ -2525,11 +2525,15 @@ class PubServer(BaseHTTPRequestHandler):
self.server.domain,
actorLiked)
if likedPostFilename:
print('Updating likes for ' + likedPostFilename)
updateLikesCollection(self.server.recentPostsCache,
self.server.baseDir,
likedPostFilename, likeUrl,
likeActor, self.server.domain,
self.server.debug)
else:
print('WARN: unable to locate file for liked post ' +
likeUrl)
# send out the like to followers
self._postToOutbox(likeJson, self.server.projectVersion)
self.server.GETbusy = False
@ -2619,6 +2623,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.domain,
actorLiked)
if likedPostFilename:
print('Removing likes for ' + likedPostFilename)
undoLikesCollectionEntry(self.server.recentPostsCache,
self.server.baseDir,
likedPostFilename, likeUrl,

View File

@ -892,7 +892,7 @@ def updateLikesCollection(recentPostsCache: {},
objectUrl = objectUrl + '/likes'
if not postJsonObject['object'].get('likes'):
if debug:
print('DEBUG: Adding initial likes to '+objectUrl)
print('DEBUG: Adding initial like to ' + objectUrl)
likesJson = {
"@context": "https://www.w3.org/ns/activitystreams",
'id': objectUrl,