Save to a named file

main
Bob Mottram 2020-11-28 12:13:04 +00:00
parent 672f466cf0
commit e5e3987699
1 changed files with 15 additions and 13 deletions

View File

@ -197,10 +197,12 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str,
# save all instance blogs to the news actor
if postToNickname != 'news' and outboxName == 'tlblogs':
if '/' in savedFilename:
savedPostId = savedFilename.split('/')[-1]
blogsDir = baseDir + '/accounts/news@' + domain + '/tlblogs'
if not os.path.isdir(blogsDir):
os.mkdir(blogsDir)
copyfile(savedFilename, blogsDir)
copyfile(savedFilename, blogsDir + '/' + savedPostId)
inboxUpdateIndex('tlblogs', baseDir,
'news@' + domain,
savedFilename, debug)