From 672f466cf07a9cb199822d4c34462faac1ce2027 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 28 Nov 2020 12:01:24 +0000 Subject: [PATCH] Copy blogs to news actor rather than saving to box --- outbox.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/outbox.py b/outbox.py index 84ee59f2..cf95f9b4 100644 --- a/outbox.py +++ b/outbox.py @@ -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 \