From 3edc55341b605ec2a0fe1bce0eeae7cc971ccd9e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 17 Oct 2021 17:49:34 +0100 Subject: [PATCH] Filename not json --- daemon.py | 12 ++++++------ posts.py | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/daemon.py b/daemon.py index 884fbfc22..d03ff3c3b 100644 --- a/daemon.py +++ b/daemon.py @@ -7372,11 +7372,11 @@ class PubServer(BaseHTTPRequestHandler): getOriginalPostFromAnnounceUrl(likeUrl, baseDir, self.postToNickname, domain) likeUrl2 = likeUrl - likedPostJson = origFilename + likedPostFilename = origFilename if origActor and origPostUrl: actorLiked = origActor likeUrl2 = origPostUrl - likedPostJson = None + likedPostFilename = None likeJson = { "@context": "https://www.w3.org/ns/activitystreams", @@ -7391,7 +7391,7 @@ class PubServer(BaseHTTPRequestHandler): print('Locating liked post ' + likeUrl) # directly like the post file - if not likedPostJson: + if not likedPostFilename: likedPostFilename = \ locatePost(baseDir, self.postToNickname, domain, likeUrl) if likedPostFilename: @@ -7538,11 +7538,11 @@ class PubServer(BaseHTTPRequestHandler): getOriginalPostFromAnnounceUrl(likeUrl, baseDir, self.postToNickname, domain) likeUrl2 = likeUrl - likedPostJson = origFilename + likedPostFilename = origFilename if origActor and origPostUrl: actorLiked = origActor likeUrl2 = origPostUrl - likedPostJson = None + likedPostFilename = None undoLikeJson = { "@context": "https://www.w3.org/ns/activitystreams", @@ -7561,7 +7561,7 @@ class PubServer(BaseHTTPRequestHandler): self._postToOutbox(undoLikeJson, self.server.projectVersion, None) # directly undo the like within the post file - if not likedPostJson: + if not likedPostFilename: likedPostFilename = locatePost(baseDir, self.postToNickname, domain, likeUrl) if likedPostFilename: diff --git a/posts.py b/posts.py index b23281bc0..9011d7d48 100644 --- a/posts.py +++ b/posts.py @@ -5089,4 +5089,5 @@ def getOriginalPostFromAnnounceUrl(announceUrl: str, baseDir: str, origPostId.split('/' + origNick + '/')[0] + \ '/' + origNick url = origPostId + return actor, url, origFilename