main
Bob Mottram 2020-05-18 11:19:31 +01:00
parent 664d087b01
commit 21c5db8ab4
1 changed files with 7 additions and 4 deletions

View File

@ -339,22 +339,25 @@ def locatePost(baseDir: str, nickname: str, domain: str,
# if this post in the shared inbox?
postUrl = postUrl.replace('/', '#').replace('/activity', '').strip()
# add the extension
postUrl = postUrl + '.' + extension
# search boxes
boxes = ('inbox', 'outbox', 'tlblogs')
accountDir = baseDir + '/accounts/' + nickname + '@' + domain + '/'
for boxName in boxes:
postFilename = baseDir + '/accounts/' + nickname + '@' + domain + \
'/' + boxName + '/' + postUrl + '.' + extension
postFilename = accountDir + boxName + '/' + postUrl
if os.path.isfile(postFilename):
return postFilename
# is it in the announce cache?
postFilename = baseDir + '/cache/announce/' + \
nickname + '/' + postUrl + '.' + extension
nickname + '/' + postUrl
if os.path.isfile(postFilename):
return postFilename
print('WARN: unable to locate ' + nickname + ' ' +
postUrl + '.' + extension)
postUrl)
return None