forked from indymedia/epicyon
Copy blogs to news actor rather than saving to box
parent
ed51cf51e7
commit
672f466cf0
20
outbox.py
20
outbox.py
|
@ -7,6 +7,7 @@ __email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from shutil import copyfile
|
||||||
from session import createSession
|
from session import createSession
|
||||||
from auth import createPassword
|
from auth import createPassword
|
||||||
from posts import outboxMessageCreateWrap
|
from posts import outboxMessageCreateWrap
|
||||||
|
@ -196,15 +197,20 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str,
|
||||||
|
|
||||||
# save all instance blogs to the news actor
|
# save all instance blogs to the news actor
|
||||||
if postToNickname != 'news' and outboxName == 'tlblogs':
|
if postToNickname != 'news' and outboxName == 'tlblogs':
|
||||||
savedFeatureFilename = \
|
blogsDir = baseDir + '/accounts/news@' + domain + '/tlblogs'
|
||||||
savePostToBox(baseDir,
|
if not os.path.isdir(blogsDir):
|
||||||
httpPrefix,
|
os.mkdir(blogsDir)
|
||||||
postId,
|
copyfile(savedFilename, blogsDir)
|
||||||
'news', domainFull,
|
|
||||||
messageJson, 'tlblogs')
|
|
||||||
inboxUpdateIndex('tlblogs', baseDir,
|
inboxUpdateIndex('tlblogs', baseDir,
|
||||||
'news@' + domain,
|
'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 \
|
if messageJson['type'] == 'Create' or \
|
||||||
messageJson['type'] == 'Question' or \
|
messageJson['type'] == 'Question' or \
|
||||||
|
|
Loading…
Reference in New Issue