forked from indymedia/epicyon
Save blogs to a separate box
parent
b1aa16017c
commit
fd24aee2fc
|
@ -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():
|
||||
|
|
11
outbox.py
11
outbox.py
|
@ -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:
|
||||
|
|
3
utils.py
3
utils.py
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue