Save blog posts to their own box

main
Bob Mottram 2020-02-24 22:50:55 +00:00
parent 7c37ffcd36
commit ac3de67ddd
2 changed files with 10 additions and 4 deletions

View File

@ -4073,7 +4073,7 @@ class PubServer(BaseHTTPRequestHandler):
# remove any trailing slashes from the path
if not self.path.endswith('confirm'):
self.path= \
self.path.replace('/outbox/','/outbox').replace('/inbox/','/inbox').replace('/shares/','/shares').replace('/sharedInbox/','/sharedInbox')
self.path.replace('/outbox/','/outbox').replace('/tlblogs/','/tlblogs').replace('/inbox/','/inbox').replace('/shares/','/shares').replace('/sharedInbox/','/sharedInbox')
if self.path=='/inbox':
if not self.server.enableSharedInbox:
@ -4093,7 +4093,7 @@ class PubServer(BaseHTTPRequestHandler):
print('POST Not authorized')
print(str(self.headers))
# if this is a POST to teh outbox then check authentication
# if this is a POST to the outbox then check authentication
self.outboxAuthenticated=False
self.postToNickname=None

View File

@ -158,8 +158,14 @@ def postMessageToOutbox(messageJson: {},postToNickname: str, \
print('DEBUG: savePostToBox')
if messageJson['type']!='Upgrade':
outboxName='outbox'
if messageJson['type']=='Article':
outboxName='tlblogs'
# if this is a blog post then save to its own box
if messageJson['type']=='Create':
if messageJson.get('object'):
if isinstance(messageJson['object'], dict):
if messageJson['object'].get('type'):
if messageJson['object']['type']=='Article':
outboxName='tlblogs'
savedFilename= \
savePostToBox(baseDir, \