Copy blogs to news actor rather than saving to box

main
Bob Mottram 2020-11-28 12:01:24 +00:00
parent ed51cf51e7
commit 672f466cf0
1 changed files with 13 additions and 7 deletions

View File

@ -7,6 +7,7 @@ __email__ = "bob@freedombone.net"
__status__ = "Production"
import os
from shutil import copyfile
from session import createSession
from auth import createPassword
from posts import outboxMessageCreateWrap
@ -196,15 +197,20 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str,
# save all instance blogs to the news actor
if postToNickname != 'news' and outboxName == 'tlblogs':
savedFeatureFilename = \
savePostToBox(baseDir,
httpPrefix,
postId,
'news', domainFull,
messageJson, 'tlblogs')
blogsDir = baseDir + '/accounts/news@' + domain + '/tlblogs'
if not os.path.isdir(blogsDir):
os.mkdir(blogsDir)
copyfile(savedFilename, blogsDir)
inboxUpdateIndex('tlblogs', baseDir,
'news@' + domain,
savedFeatureFilename, debug)
savedFilename, debug)
# clear the citations file if it exists
citationsFilename = \
baseDir + '/accounts/' + \
postToNickname + '@' + domain + '/.citations.txt'
if os.path.isfile(citationsFilename):
os.remove(citationsFilename)
if messageJson['type'] == 'Create' or \
messageJson['type'] == 'Question' or \