main
Bob Mottram 2021-07-07 12:03:16 +01:00
parent f294fbd356
commit e65ad3bcc2
1 changed files with 69 additions and 98 deletions

View File

@ -7832,22 +7832,23 @@ class PubServer(BaseHTTPRequestHandler):
statusNumber = postSections[2]
if len(statusNumber) <= 10 or (not statusNumber.isdigit()):
return False
postFilename = \
baseDir + '/accounts/' + \
nickname + '@' + \
domain + '/outbox/' + \
httpPrefix + ':##' + \
domainFull + '#users#' + \
nickname + '#statuses#' + \
statusNumber + '.json'
if os.path.isfile(postFilename):
baseDir + '/accounts/' + nickname + '@' + domain + '/outbox/' + \
httpPrefix + ':##' + domainFull + '#users#' + nickname + \
'#statuses#' + statusNumber + '.json'
if not os.path.isfile(postFilename):
self._404()
self.server.GETbusy = False
return True
postJsonObject = loadJson(postFilename)
if not postJsonObject:
self.send_response(429)
self.end_headers()
self.server.GETbusy = False
return True
else:
# Only authorized viewers get to see likes
# on posts
# Otherwize marketers could gain more social
@ -7859,52 +7860,27 @@ class PubServer(BaseHTTPRequestHandler):
self.server.GETbusy = False
return True
removePostInteractions(pjo, True)
if self._requestHTTP():
recentPostsCache = \
self.server.recentPostsCache
maxRecentPosts = \
self.server.maxRecentPosts
translate = \
self.server.translate
cachedWebfingers = \
self.server.cachedWebfingers
personCache = \
self.server.personCache
projectVersion = \
self.server.projectVersion
ytDomain = \
self.server.YTReplacementDomain
showPublishedDateOnly = \
self.server.showPublishedDateOnly
peertubeInstances = \
self.server.peertubeInstances
allowLocalNetworkAccess = \
self.server.allowLocalNetworkAccess
themeName = \
self.server.themeName
msg = \
htmlIndividualPost(self.server.cssCache,
recentPostsCache,
maxRecentPosts,
translate,
self.server.recentPostsCache,
self.server.maxRecentPosts,
self.server.translate,
baseDir,
self.server.session,
cachedWebfingers,
personCache,
nickname,
domain,
port,
self.server.cachedWebfingers,
self.server.personCache,
nickname, domain, port,
authorized,
postJsonObject,
httpPrefix,
projectVersion,
self.server.projectVersion,
likedBy,
ytDomain,
showPublishedDateOnly,
peertubeInstances,
allowLocalNetworkAccess,
themeName)
self.server.YTReplacementDomain,
self.server.showPublishedDateOnly,
self.server.peertubeInstances,
self.server.allowLocalNetworkAccess,
self.server.themeName)
msg = msg.encode('utf-8')
msglen = len(msg)
self._set_headers('text/html', msglen,
@ -7929,11 +7905,6 @@ class PubServer(BaseHTTPRequestHandler):
self._404()
self.server.GETbusy = False
return True
else:
self._404()
self.server.GETbusy = False
return True
return False
def _showInbox(self, authorized: bool,
callingDomain: str, path: str,