From 12dfd89ba92ef129286ea930b9f4f7dc1b1b5ef2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 3 Sep 2021 17:02:29 +0100 Subject: [PATCH] Update likes collection after sending --- daemon.py | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/daemon.py b/daemon.py index 15c94b2a0..39ad0c6e5 100644 --- a/daemon.py +++ b/daemon.py @@ -7130,7 +7130,11 @@ class PubServer(BaseHTTPRequestHandler): 'to': [actorLiked], 'object': likeUrl } - print('Locating liked post') + + # send out the like to followers + self._postToOutbox(likeJson, self.server.projectVersion, None) + + print('Locating liked post ' + likeUrl) # directly like the post file likedPostFilename = locatePost(baseDir, self.postToNickname, @@ -7170,7 +7174,9 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, likedPostJson, None, True, self.server.allowDeletion, - httpPrefix, __version__, timelineStr, + httpPrefix, + self.server.projectVersion, + timelineStr, self.server.YTReplacementDomain, self.server.showPublishedDateOnly, self.server.peertubeInstances, @@ -7190,8 +7196,7 @@ class PubServer(BaseHTTPRequestHandler): else: print('WARN: unable to locate file for liked post ' + likeUrl) - # send out the like to followers - self._postToOutbox(likeJson, self.server.projectVersion, None) + self.server.GETbusy = False actorAbsolute = self._getInstalceUrl(callingDomain) + actor actorPathStr = \ @@ -7273,6 +7278,10 @@ class PubServer(BaseHTTPRequestHandler): 'object': likeUrl } } + + # send out the undo like to followers + self._postToOutbox(undoLikeJson, self.server.projectVersion, None) + # directly undo the like within the post file likedPostFilename = locatePost(baseDir, self.postToNickname, @@ -7307,7 +7316,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, likedPostJson, None, True, self.server.allowDeletion, - httpPrefix, __version__, timelineStr, + httpPrefix, + self.server.projectVersion, timelineStr, self.server.YTReplacementDomain, self.server.showPublishedDateOnly, self.server.peertubeInstances, @@ -7321,8 +7331,7 @@ class PubServer(BaseHTTPRequestHandler): False, True, False) else: print('WARN: Unliked post not found: ' + likedPostFilename) - # send out the undo like to followers - self._postToOutbox(undoLikeJson, self.server.projectVersion, None) + self.server.GETbusy = False actorAbsolute = self._getInstalceUrl(callingDomain) + actor actorPathStr = \ @@ -7438,7 +7447,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, bookmarkPostJson, None, True, self.server.allowDeletion, - httpPrefix, __version__, timelineStr, + httpPrefix, self.server.projectVersion, + timelineStr, self.server.YTReplacementDomain, self.server.showPublishedDateOnly, self.server.peertubeInstances, @@ -7569,7 +7579,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, bookmarkPostJson, None, True, self.server.allowDeletion, - httpPrefix, __version__, timelineStr, + httpPrefix, + self.server.projectVersion, timelineStr, self.server.YTReplacementDomain, self.server.showPublishedDateOnly, self.server.peertubeInstances, @@ -7766,7 +7777,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, mutePostJson, None, True, self.server.allowDeletion, - httpPrefix, __version__, timelineStr, + httpPrefix, + self.server.projectVersion, timelineStr, self.server.YTReplacementDomain, self.server.showPublishedDateOnly, self.server.peertubeInstances, @@ -7864,7 +7876,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.port, mutePostJson, None, True, self.server.allowDeletion, - httpPrefix, __version__, timelineStr, + httpPrefix, + self.server.projectVersion, timelineStr, self.server.YTReplacementDomain, self.server.showPublishedDateOnly, self.server.peertubeInstances,