Show previous posts in reply sequence

master
Bob Mottram 2019-08-02 20:47:30 +01:00
parent bbae1dc77d
commit c8de658f77
1 changed files with 16 additions and 1 deletions

View File

@ -803,7 +803,22 @@ def htmlIndividualPost(baseDir: str,session,wfRequest: {},personCache: {}, \
postStr= \ postStr= \
individualPostAsHtml(baseDir,session,wfRequest,personCache, \ individualPostAsHtml(baseDir,session,wfRequest,personCache, \
nickname,domain,port,postJsonObject,None,True,False) nickname,domain,port,postJsonObject,None,True,False)
postFilename=locatePost(baseDir,nickname,domain,postJsonObject['id'].replace('/activity','')) messageId=postJsonObject['id'].replace('/activity','')
# show the previous posts
while postJsonObject['object'].get('inReplyTo'):
postFilename=locatePost(baseDir,nickname,domain,postJsonObject['object']['inReplyTo'])
if not postFilename:
break
with open(postFilename, 'r') as fp:
postJsonObject=commentjson.load(fp)
postStr= \
individualPostAsHtml(baseDir,session,wfRequest,personCache, \
nickname,domain,port,postJsonObject, \
None,True,False)+postStr
# show the following posts
postFilename=locatePost(baseDir,nickname,domain,messageId)
if postFilename: if postFilename:
# is there a replies file for this post? # is there a replies file for this post?
repliesFilename=postFilename.replace('.json','.replies') repliesFilename=postFilename.replace('.json','.replies')