Liking announces

main
Bob Mottram 2021-10-13 18:40:42 +01:00
parent 247c689c62
commit 00f8531c9c
2 changed files with 7 additions and 6 deletions

View File

@ -7378,10 +7378,8 @@ class PubServer(BaseHTTPRequestHandler):
print('Locating liked post ' + likeUrl)
# directly like the post file
likedPostFilename = locatePost(baseDir,
self.postToNickname,
domain,
likeUrl)
likedPostFilename = \
locatePost(baseDir, self.postToNickname, domain, likeUrl)
if likedPostFilename:
# if debug:
print('Updating likes for ' + likedPostFilename)

View File

@ -545,7 +545,7 @@ def _getLikeIconHtml(nickname: str, domainFull: str,
likeStr += '<label class="likesCount">'
likeStr += likeCountStr.replace('(', '').replace(')', '').strip()
likeStr += '</label>\n'
likePostId = removeIdEnding(postJsonObject['object']['id'])
likePostId = removeIdEnding(postJsonObject['id'])
likeStr += \
' <a class="imageAnchor" href="/users/' + nickname + '?' + \
likeLink + '=' + likePostId + \
@ -1525,10 +1525,13 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
if os.path.isfile(hideLikeButtonFile):
showLikeButton = False
likeJsonObject = postJsonObject
if announceJsonObject:
likeJsonObject = announceJsonObject
likeStr = _getLikeIconHtml(nickname, domainFull,
isModerationPost,
showLikeButton,
postJsonObject,
likeJsonObject,
enableTimingLog,
postStartTime,
translate, pageNumberParam,