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