Save blogs to a separate box

main
Bob Mottram 2020-02-24 22:07:13 +00:00
parent b1aa16017c
commit fd24aee2fc
3 changed files with 10 additions and 6 deletions

View File

@ -888,7 +888,7 @@ class PubServer(BaseHTTPRequestHandler):
if not userEnding2[1].isdigit():
return None,None
# check for blog posts
blogIndexFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/outbox.index'
blogIndexFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/tlblogs.index'
if not os.path.isfile(blogIndexFilename):
return None,None
if '#'+userEnding2[1]+'.' not in open(blogIndexFilename).read():

View File

@ -22,6 +22,7 @@ from media import replaceYouTube
from media import getMediaPath
from media import createMediaDirs
from inbox import inboxUpdateIndex
from inbox import isBlogPost
from announce import outboxAnnounce
from follow import outboxUndoFollow
from roles import outboxDelegate
@ -156,20 +157,24 @@ def postMessageToOutbox(messageJson: {},postToNickname: str, \
if debug:
print('DEBUG: savePostToBox')
if messageJson['type']!='Upgrade':
outboxName='outbox'
if messageJson['type']=='Article':
outboxName='tlblogs'
savedFilename= \
savePostToBox(baseDir, \
httpPrefix, \
postId, \
postToNickname, \
domainFull,messageJson,'outbox')
domainFull,messageJson,outboxName)
if messageJson['type']=='Create' or \
messageJson['type']=='Question' or \
messageJson['type']=='Note' or \
messageJson['type']=='Article' or \
messageJson['type']=='Announce':
inboxUpdateIndex('outbox',baseDir, \
inboxUpdateIndex(outboxName,baseDir, \
postToNickname+'@'+domain, \
savedFilename,debug)
savedFilename,debug)
if outboxAnnounce(recentPostsCache, \
baseDir,messageJson,debug):
if debug:

View File

@ -279,8 +279,7 @@ def locatePost(baseDir: str,nickname: str,domain: str,postUrl: str,replies=False
if os.path.isfile(postFilename):
return postFilename
# if this post in the inbox of the person?
boxName='inbox'
boxName='tlblogs'
postFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/'+boxName+'/'+postUrl+'.'+extension
if os.path.isfile(postFilename):
return postFilename