Use full post id

main
Bob Mottram 2021-09-03 20:57:22 +01:00
parent 36077696a8
commit e97dc8c8ce
1 changed files with 40 additions and 43 deletions

View File

@ -6740,13 +6740,14 @@ class PubServer(BaseHTTPRequestHandler):
# save the announce straight to the outbox # save the announce straight to the outbox
# This is because the subsequent send is within a separate thread # This is because the subsequent send is within a separate thread
# but the html still needs to be generated before this call ends # but the html still needs to be generated before this call ends
announceId = removeIdEnding(announceJson['id']) # announceId = removeIdEnding(announceJson['id'])
announceId = announceJson['id']
announceFilename = \ announceFilename = \
savePostToBox(baseDir, httpPrefix, announceId, savePostToBox(baseDir, httpPrefix, announceId,
self.postToNickname, domainFull, self.postToNickname, domainFull,
announceJson, 'outbox') announceJson, 'outbox')
# also copy the post id to the inbox index # also copy the post id to the inbox index
indexes = ['outbox', 'inbox'] indexes = ['inbox']
for boxNameIndex in indexes: for boxNameIndex in indexes:
inboxUpdateIndex(boxNameIndex, baseDir, inboxUpdateIndex(boxNameIndex, baseDir,
self.postToNickname + '@' + domain, self.postToNickname + '@' + domain,
@ -6760,48 +6761,44 @@ class PubServer(BaseHTTPRequestHandler):
self._postToOutboxThread(announceJson) self._postToOutboxThread(announceJson)
# generate the html for the announce # generate the html for the announce
if announceFilename: if announceJson and announceFilename:
print('Generating html post for announce') print('Generating html post for announce')
announcePostJson = loadJson(announceFilename, 0, 1) cachedPostFilename = \
if announcePostJson: getCachedPostFilename(baseDir, self.postToNickname,
cachedPostFilename = \ domain, announceJson)
getCachedPostFilename(baseDir, self.postToNickname, print('Announced post json: ' + str(announceJson))
domain, announcePostJson) print('Announced post nickname: ' +
print('Announced post json: ' + str(announcePostJson)) self.postToNickname + ' ' + domain)
print('Announced post nickname: ' + print('Announced post cache: ' + str(cachedPostFilename))
self.postToNickname + ' ' + domain) showIndividualPostIcons = True
print('Announced post cache: ' + str(cachedPostFilename)) manuallyApproveFollowers = \
showIndividualPostIcons = True followerApprovalActive(baseDir,
manuallyApproveFollowers = \ self.postToNickname, domain)
followerApprovalActive(baseDir, individualPostAsHtml(self.server.signingPrivateKeyPem, False,
self.postToNickname, domain) self.server.recentPostsCache,
individualPostAsHtml(self.server.signingPrivateKeyPem, False, self.server.maxRecentPosts,
self.server.recentPostsCache, self.server.translate,
self.server.maxRecentPosts, pageNumber, baseDir,
self.server.translate, self.server.session,
pageNumber, baseDir, self.server.cachedWebfingers,
self.server.session, self.server.personCache,
self.server.cachedWebfingers, self.postToNickname, domain,
self.server.personCache, self.server.port, announceJson,
self.postToNickname, domain, None, True,
self.server.port, announcePostJson, self.server.allowDeletion,
None, True, httpPrefix, self.server.projectVersion,
self.server.allowDeletion, timelineStr,
httpPrefix, self.server.projectVersion, self.server.YTReplacementDomain,
timelineStr, self.server.showPublishedDateOnly,
self.server.YTReplacementDomain, self.server.peertubeInstances,
self.server.showPublishedDateOnly, self.server.allowLocalNetworkAccess,
self.server.peertubeInstances, self.server.themeName,
self.server.allowLocalNetworkAccess, self.server.systemLanguage,
self.server.themeName, self.server.maxLikeCount,
self.server.systemLanguage, not isDM(announceJson),
self.server.maxLikeCount, showIndividualPostIcons,
not isDM(announcePostJson), manuallyApproveFollowers,
showIndividualPostIcons, False, True, False)
manuallyApproveFollowers,
False, True, False)
else:
print('WARN: Announced post not found: ' + announceFilename)
self.server.GETbusy = False self.server.GETbusy = False
actorAbsolute = self._getInstalceUrl(callingDomain) + actor actorAbsolute = self._getInstalceUrl(callingDomain) + actor