main
Bob Mottram 2020-05-18 11:14:29 +01:00
parent 0c8d3ab698
commit 664d087b01
1 changed files with 9 additions and 17 deletions

View File

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